Skip to content

Commit cabf546

Browse files
authored
Merge pull request #1 from kuto5046/feature/switch_lua
Feature/switch lua
2 parents ffca91f + d65c475 commit cabf546

20 files changed

Lines changed: 569 additions & 162 deletions

.config/nvim/dein.toml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.config/nvim/init.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require("base")
2+
require("autocmds")
3+
require("options")
4+
require("keymaps")
5+
require("colorscheme")
6+
require("plugins")

.config/nvim/init.vim

Lines changed: 0 additions & 48 deletions
This file was deleted.

.config/nvim/lua/autocmds.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
local augroup = vim.api.nvim_create_augroup -- Create/get autocommand group
2+
local autocmd = vim.api.nvim_create_autocmd -- Create autocommand
3+
4+
-- Remove whitespace on save
5+
autocmd("BufWritePre", {
6+
pattern = "*",
7+
command = ":%s/\\s\\+$//e",
8+
})
9+
10+
-- Don't auto commenting new lines
11+
autocmd("BufEnter", {
12+
pattern = "*",
13+
command = "set fo-=c fo-=r fo-=o",
14+
})
15+
16+
-- Restore cursor location when file is opened
17+
autocmd({ "BufReadPost" }, {
18+
pattern = { "*" },
19+
callback = function()
20+
vim.api.nvim_exec('silent! normal! g`"zv', false)
21+
end,
22+
})

.config/nvim/lua/base.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- vim.cmd("autocmd!")
2+
vim.scriptencoding = "utf-8"
3+
vim.wo.number = true

.config/nvim/lua/colorscheme.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vim.cmd("colorscheme nightfox")

.config/nvim/lua/keymaps.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
local opts = { noremap = true, silent = true }
2+
local term_opts = { silent = true }
3+
4+
local keymap = vim.api.nvim_set_keymap
5+
6+
--Spaceキーをleaderに設定
7+
keymap("", "<Space>", "<Nop>", opts)
8+
vim.g.mapleader = " "
9+
vim.g.maplocalleader = " "

.config/nvim/lua/options.lua

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
local options = {
2+
encoding = "utf-8",
3+
fileencoding = "utf-8",
4+
title = true,
5+
backup = false,
6+
clipboard = "unnamedplus",
7+
cmdheight = 2,
8+
completeopt = { "menuone", "noselect" },
9+
conceallevel = 0,
10+
hlsearch = true,
11+
ignorecase = true,
12+
mouse = "a",
13+
pumheight = 10,
14+
showmode = false,
15+
showtabline = 2,
16+
smartcase = true,
17+
smartindent = true,
18+
swapfile = false,
19+
termguicolors = true,
20+
timeoutlen = 300,
21+
undofile = true,
22+
updatetime = 300,
23+
writebackup = false,
24+
shell = "fish",
25+
backupskip = { "/tmp/*", "/private/tmp/*" },
26+
expandtab = true,
27+
shiftwidth = 2,
28+
tabstop = 2,
29+
cursorline = true,
30+
number = true,
31+
relativenumber = false,
32+
numberwidth = 4,
33+
signcolumn = "yes",
34+
wrap = false,
35+
winblend = 0,
36+
wildoptions = "pum",
37+
pumblend = 5,
38+
-- background = "dark",
39+
scrolloff = 8,
40+
sidescrolloff = 8,
41+
guifont = "monospace:h17",
42+
splitbelow = false, -- オンのとき、ウィンドウを横分割すると新しいウィンドウはカレントウィンドウの下に開かれる
43+
splitright = false, -- オンのとき、ウィンドウを縦分割すると新しいウィンドウはカレントウィンドウの右に開かれる
44+
termguicolors = true
45+
}
46+
47+
vim.opt.shortmess:append("c")
48+
49+
for k, v in pairs(options) do
50+
vim.opt[k] = v
51+
end
52+
53+
vim.cmd("set whichwrap+=<,>,[,],h,l")
54+
vim.cmd([[set iskeyword+=-]])
55+
vim.cmd([[set formatoptions-=cro]]) -- TODO: this doesn't seem to work

.config/nvim/lua/plugins.lua

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
local fn = vim.fn
2+
3+
-- Automatically install packer
4+
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
5+
if fn.empty(fn.glob(install_path)) > 0 then
6+
PACKER_BOOTSTRAP = fn.system({
7+
"git",
8+
"clone",
9+
"--depth",
10+
"1",
11+
"https://github.com/wbthomason/packer.nvim",
12+
install_path,
13+
})
14+
print("Installing packer close and reopen Neovim...")
15+
vim.cmd([[packadd packer.nvim]])
16+
end
17+
18+
-- Autocommand that reloads neovim whenever you save the plugins.lua file
19+
vim.cmd([[
20+
augroup packer_user_config
21+
autocmd!
22+
autocmd BufWritePost plugins.lua source <afile> | PackerSync
23+
augroup end
24+
]])
25+
26+
-- Use a protected call so we don't error out on first use
27+
local status_ok, packer = pcall(require, "packer")
28+
if not status_ok then
29+
return
30+
end
31+
32+
-- Have packer use a popup window
33+
packer.init({
34+
display = {
35+
open_fn = function()
36+
return require("packer.util").float({ border = "rounded" })
37+
end,
38+
},
39+
})
40+
41+
-- Install your plugins here
42+
return packer.startup(function(use)
43+
-- My plugins here
44+
use({ "wbthomason/packer.nvim" })
45+
use({ "nvim-lua/plenary.nvim" }) -- Common utilities
46+
47+
-- Colorschemes
48+
use({ "EdenEast/nightfox.nvim" })
49+
50+
-- 括弧
51+
use {
52+
"windwp/nvim-autopairs",
53+
config = function() require("nvim-autopairs").setup {} end
54+
}
55+
use {
56+
'andymass/vim-matchup',
57+
setup = function()
58+
-- may set any options here
59+
vim.g.matchup_matchparen_offscreen = { method = "popup" }
60+
end
61+
}
62+
63+
-- 補完
64+
use({ "hrsh7th/cmp-nvim-lsp" }) -- lsp 用の補完ソース。
65+
use({ "hrsh7th/cmp-buffer" }) -- buffer completions
66+
use({ "hrsh7th/cmp-path" }) -- path completions
67+
use({ "hrsh7th/cmp-cmdline" }) -- cmdline completions
68+
use({ "hrsh7th/nvim-cmp" }) -- The completion plugin
69+
-- use({ "hrsh7th/cmp-nvim-lua" }) -- lua用の補完ソース
70+
71+
-- snippets (luasnip)
72+
-- use({ "L3MON4D3/LuaSnip" })
73+
-- use({ "saadparwaiz1/cmp_luasnip"})
74+
75+
-- LSP(メジャーな言語のLSPはこれで対応可能)
76+
use({ "williamboman/mason.nvim" })
77+
use({ "williamboman/mason-lspconfig.nvim" })
78+
use({ "neovim/nvim-lspconfig" })
79+
80+
use({ "jose-elias-alvarez/null-ls.nvim" }) -- for formatters and linters
81+
82+
-- Telescope
83+
use({ "nvim-telescope/telescope.nvim" })
84+
use({ "nvim-telescope/telescope-file-browser.nvim" })
85+
-- use({
86+
-- "nvim-telescope/telescope-frecency.nvim",
87+
-- config = function()
88+
-- require"telescope".load_extension("frecency")
89+
-- end,
90+
-- requires = {"kkharji/sqlite.lua"}
91+
-- })
92+
93+
-- Treesitter
94+
use {
95+
'nvim-treesitter/nvim-treesitter',
96+
run = function()
97+
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
98+
ts_update()
99+
end,
100+
}
101+
102+
-- markdown preview
103+
use({
104+
"iamcco/markdown-preview.nvim",
105+
run = function() vim.fn["mkdp#util#install"]() end,
106+
})
107+
-- use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })
108+
109+
-- 見た目
110+
use {
111+
'nvim-lualine/lualine.nvim',
112+
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
113+
}
114+
use({ "kyazdani42/nvim-web-devicons" }) -- File icons
115+
use {'akinsho/bufferline.nvim', tag = "v3.*", requires = 'nvim-tree/nvim-web-devicons'}
116+
use({ 'mvllow/modes.nvim', tag = 'v0.2.0' }) -- 行の色でモードが分かる
117+
use({ "petertriho/nvim-scrollbar"} ) -- スクロールバーを表示
118+
-- 検索したワードの場所がわかりやすくなる
119+
-- use {
120+
-- "kevinhwang91/nvim-hlslens",
121+
-- config = function()
122+
-- require("scrollbar.handlers.search").setup({
123+
-- })
124+
-- end,
125+
-- }
126+
-- gitのsignが出る
127+
-- use {
128+
-- "lewis6991/gitsigns.nvim",
129+
-- config = function()
130+
-- require('gitsigns').setup()
131+
-- require("scrollbar.handlers.gitsigns").setup()
132+
-- end
133+
-- }
134+
135+
-- Automatically set up your configuration after cloning packer.nvim
136+
-- Put this at the end after all plugins
137+
if PACKER_BOOTSTRAP then
138+
require("packer").sync()
139+
end
140+
end)
141+

.config/nvim/plugin/bufferline.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vim.opt.termguicolors = true
2+
require("bufferline").setup{}

0 commit comments

Comments
 (0)