Add submoduules of used nvim plugins
This commit is contained in:
parent
0790ede88a
commit
98b80f1adf
16 changed files with 240 additions and 0 deletions
39
.gitmodules
vendored
Normal file
39
.gitmodules
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
[submodule "pack/packages/start/dracula_vim_colorscheme"]
|
||||
path = pack/packages/start/dracula_vim_colorscheme
|
||||
url = https://github.com/dracula/vim.git
|
||||
[submodule "pack/packages/start/nvim-quickcomment"]
|
||||
path = pack/packages/start/nvim-quickcomment
|
||||
url = https://github.com/Stephen-Seo/nvim-quickcomment.git
|
||||
[submodule "pack/packages/start/nvim-treesitter"]
|
||||
path = pack/packages/start/nvim-treesitter
|
||||
url = https://github.com/nvim-treesitter/nvim-treesitter.git
|
||||
[submodule "pack/packages/start/vim-gitgutter"]
|
||||
path = pack/packages/start/vim-gitgutter
|
||||
url = https://github.com/airblade/vim-gitgutter.git
|
||||
[submodule "pack/packages/start/vim-localvimrc"]
|
||||
path = pack/packages/start/vim-localvimrc
|
||||
url = https://github.com/embear/vim-localvimrc.git
|
||||
[submodule "lsppack/pack/lsppackages/start/cmp-buffer"]
|
||||
path = lsppack/pack/lsppackages/start/cmp-buffer
|
||||
url = https://github.com/hrsh7th/cmp-buffer.git
|
||||
[submodule "lsppack/pack/lsppackages/start/cmp-cmdline"]
|
||||
path = lsppack/pack/lsppackages/start/cmp-cmdline
|
||||
url = https://github.com/hrsh7th/cmp-cmdline.git
|
||||
[submodule "lsppack/pack/lsppackages/start/cmp-nvim-lsp"]
|
||||
path = lsppack/pack/lsppackages/start/cmp-nvim-lsp
|
||||
url = https://github.com/hrsh7th/cmp-nvim-lsp.git
|
||||
[submodule "lsppack/pack/lsppackages/start/cmp-path"]
|
||||
path = lsppack/pack/lsppackages/start/cmp-path
|
||||
url = https://github.com/hrsh7th/cmp-path.git
|
||||
[submodule "lsppack/pack/lsppackages/start/cmp-vsnip"]
|
||||
path = lsppack/pack/lsppackages/start/cmp-vsnip
|
||||
url = https://github.com/hrsh7th/cmp-vsnip.git
|
||||
[submodule "lsppack/pack/lsppackages/start/nvim-cmp"]
|
||||
path = lsppack/pack/lsppackages/start/nvim-cmp
|
||||
url = https://github.com/hrsh7th/nvim-cmp.git
|
||||
[submodule "lsppack/pack/lsppackages/start/nvim-lspconfig"]
|
||||
path = lsppack/pack/lsppackages/start/nvim-lspconfig
|
||||
url = https://github.com/neovim/nvim-lspconfig.git
|
||||
[submodule "lsppack/pack/lsppackages/start/vim-vsnip"]
|
||||
path = lsppack/pack/lsppackages/start/vim-vsnip
|
||||
url = https://github.com/hrsh7th/vim-vsnip.git
|
76
init.lua
Normal file
76
init.lua
Normal file
|
@ -0,0 +1,76 @@
|
|||
-- settings
|
||||
vim.o.nu = true
|
||||
-- truecolor
|
||||
vim.o.termguicolors = true
|
||||
-- color scheme
|
||||
--vim.g.colors_name = "jellybeans"
|
||||
--vim.api.nvim_command("color jellybeans")
|
||||
vim.api.nvim_command("let g:dracula_colorterm = 0")
|
||||
vim.api.nvim_command("color dracula")
|
||||
vim.o.hlsearch = true
|
||||
--vim.g.syntax = "on" -- unknown how to do this in lua, but is default on
|
||||
vim.o.expandtab = true
|
||||
vim.o.tabstop = 4
|
||||
vim.o.softtabstop = 4
|
||||
vim.o.shiftwidth = 4
|
||||
vim.o.colorcolumn = "80"
|
||||
vim.o.scrolloff = 4
|
||||
vim.o.mouse = "a"
|
||||
vim.o.guifont = "JetBrainsMono 10"
|
||||
vim.api.nvim_command('au BufEnter * hi ColorColumn guibg=red ctermbg=red')
|
||||
|
||||
-- git commit
|
||||
vim.api.nvim_command('autocmd FileType gitcommit setlocal colorcolumn=50,72')
|
||||
|
||||
-- Allow tabs in Makefiles.
|
||||
vim.api.nvim_command('autocmd FileType make,automake set noexpandtab shiftwidth=4 softtabstop=4')
|
||||
-- Trailing whitespace and tabs are forbidden, so highlight them.
|
||||
vim.api.nvim_command('highlight ForbiddenWhitespace ctermbg=yellow guibg=yellow')
|
||||
vim.api.nvim_command('match ForbiddenWhitespace /\\s\\+$\\|\\t/')
|
||||
-- Do not highlight spaces at the end of line while typing on that line.
|
||||
vim.api.nvim_command('autocmd InsertEnter * match ForbiddenWhitespace /\\t\\|\\s\\+\\%#\\@<!$/')
|
||||
|
||||
-- Godot's GDScript (not used since using vim-godot plugin)
|
||||
--vim.api.nvim_command('au BufNewFile,BufRead *.gd set noet')
|
||||
|
||||
-- Custom highlight group
|
||||
vim.api.nvim_command('hi! CustomRedHighlight ctermbg=red guibg=red')
|
||||
vim.api.nvim_command('match CustomRedHighlight /TODO/')
|
||||
|
||||
|
||||
vim.cmd(
|
||||
[[
|
||||
" CJK imput
|
||||
function CJKInput()
|
||||
let l:cmd = 'zenity --entry --text=CJK-Input 2>/dev/null'
|
||||
let l:output = system(l:cmd)
|
||||
let l:output = substitute(l:output, '[\r\n]*$', '', '')
|
||||
execute 'normal i' . l:output
|
||||
endfunction
|
||||
nmap <silent> <leader>i :call CJKInput()<CR>
|
||||
]])
|
||||
|
||||
--vim.cmd('nmap q :echo "I accidentally hit q, I don\'t use macros"<CR>')
|
||||
--vim.cmd('vmap q <ESC>:echo "I accidentally hit q, I don\'t use macros"<CR>')
|
||||
|
||||
vim.cmd('nmap q :lua vim.g.quickcomment_togglecommentline()<CR>')
|
||||
vim.cmd('vmap q :luado vim.g.quickcomment_togglecommentline(linenr)<CR>')
|
||||
|
||||
vim.g.quickcomment_whitespaceprefix = 1
|
||||
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = { "c", "cpp", "rust", "lua" },
|
||||
sync_install = false,
|
||||
ignore_install = { "javascript" },
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
|
||||
vim.g.foldmethod_treesitter_fn = function ()
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
end
|
1
lsppack/pack/lsppackages/start/cmp-buffer
Submodule
1
lsppack/pack/lsppackages/start/cmp-buffer
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 3022dbc9166796b644a841a02de8dd1cc1d311fa
|
1
lsppack/pack/lsppackages/start/cmp-cmdline
Submodule
1
lsppack/pack/lsppackages/start/cmp-cmdline
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 8ee981b4a91f536f52add291594e89fb6645e451
|
1
lsppack/pack/lsppackages/start/cmp-nvim-lsp
Submodule
1
lsppack/pack/lsppackages/start/cmp-nvim-lsp
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 44b16d11215dce86f253ce0c30949813c0a90765
|
1
lsppack/pack/lsppackages/start/cmp-path
Submodule
1
lsppack/pack/lsppackages/start/cmp-path
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 91ff86cd9c29299a64f968ebb45846c485725f23
|
1
lsppack/pack/lsppackages/start/cmp-vsnip
Submodule
1
lsppack/pack/lsppackages/start/cmp-vsnip
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 989a8a73c44e926199bfd05fa7a516d51f2d2752
|
1
lsppack/pack/lsppackages/start/nvim-cmp
Submodule
1
lsppack/pack/lsppackages/start/nvim-cmp
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 2743dd989e9b932e1b4813a4927d7b84272a14e2
|
1
lsppack/pack/lsppackages/start/nvim-lspconfig
Submodule
1
lsppack/pack/lsppackages/start/nvim-lspconfig
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 5dd8e2f105f08832ddbff1964bdde6d152aca793
|
1
lsppack/pack/lsppackages/start/vim-vsnip
Submodule
1
lsppack/pack/lsppackages/start/vim-vsnip
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 7753ba9c10429c29d25abfd11b4c60b76718c438
|
1
pack/packages/start/dracula_vim_colorscheme
Submodule
1
pack/packages/start/dracula_vim_colorscheme
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 3e52a0682a53dd7c2c53133d45948f5a49c5fd9a
|
112
pack/packages/start/loadlsp/autoload/loadlsp.vim
Normal file
112
pack/packages/start/loadlsp/autoload/loadlsp.vim
Normal file
|
@ -0,0 +1,112 @@
|
|||
function! loadlsp#loadlspall()
|
||||
|
||||
if exists("g:loadlspall_loaded") && g:loadlspall_loaded == 1
|
||||
echo "Already loaded"
|
||||
return
|
||||
else
|
||||
let g:loadlspall_loaded = 1
|
||||
endif
|
||||
|
||||
let l:lsppack_path = "/.config/nvim/lsppack"
|
||||
|
||||
let &packpath = &packpath
|
||||
\ . "," . environ()["HOME"]
|
||||
\ . l:lsppack_path
|
||||
|
||||
packloadall!
|
||||
|
||||
" lsp
|
||||
|
||||
"set completeopt=menu,menuone,noselect
|
||||
|
||||
lua <<EOF
|
||||
local lspconfig = require'lspconfig'
|
||||
local cmp = require'cmp'
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-d>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||
['<C-u>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||
['<C-e>'] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
['<Tab>'] = cmp.mapping(cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), { 'i', 's' }),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'vsnip' }
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup.cmdline('/', {
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(':', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
})
|
||||
})
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
lspconfig.clangd.setup {
|
||||
cmd = {"clangd", "--completion-style=detailed"},
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
local rust_features = {}
|
||||
|
||||
if string.find(vim.fn.getcwd(), "git/mpd_info_screen") then
|
||||
table.insert(rust_features, "unicode_support")
|
||||
end
|
||||
|
||||
lspconfig.rust_analyzer.setup {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
["cargo"] = {
|
||||
["features"] = rust_features,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
lspconfig.gdscript.setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
lspconfig.jedi_language_server.setup{
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- apply available fix
|
||||
vim.api.nvim_set_keymap("n", "<C-F>", "<cmd>lua vim.lsp.buf.code_action()<CR>", {noremap = true})
|
||||
-- goto next warning/error
|
||||
--vim.api.nvim_set_keymap("n", "<C-N>", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", {noremap = true})
|
||||
vim.api.nvim_set_keymap("n", "<C-N>", "<cmd>lua vim.diagnostic.goto_next()<CR>", {noremap = true})
|
||||
|
||||
EOF
|
||||
|
||||
" init after/ sources
|
||||
let after_scripts = glob(environ()["HOME"] . l:lsppack_path . "/pack/*/start/*/after/**", 0, 1)
|
||||
for item in after_scripts
|
||||
if item =~ ".*\.lua$" || item =~ ".*\.vim$"
|
||||
execute 'source' item
|
||||
endif
|
||||
endfor
|
||||
|
||||
echo 'loaded lsp plugins'
|
||||
|
||||
endfunction
|
1
pack/packages/start/nvim-quickcomment
Submodule
1
pack/packages/start/nvim-quickcomment
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit edf814111b70d72ef5a25bb801036deae7e09768
|
1
pack/packages/start/nvim-treesitter
Submodule
1
pack/packages/start/nvim-treesitter
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit e1ab5391e5c4820dd1ffc2566d29b01573ab52a9
|
1
pack/packages/start/vim-gitgutter
Submodule
1
pack/packages/start/vim-gitgutter
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 4a7ca061af2b199a9b97041270611439e8fa2b02
|
1
pack/packages/start/vim-localvimrc
Submodule
1
pack/packages/start/vim-localvimrc
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit ebb73832e6795967e5a52db3636a37282871b218
|
Loading…
Reference in a new issue