feat(nvim): add autoindent and JS lsp

This commit is contained in:
matt1432 2023-09-19 11:51:02 -04:00
parent d5a9b24de1
commit c6d65aee19
2 changed files with 21 additions and 2 deletions

View file

@ -40,3 +40,20 @@ require("neo-tree").setup({
})
require('todo-comments').setup()
require("scrollbar").setup()
-- Auto indent when pressing Enter between brackets
local remap = vim.api.nvim_set_keymap
local npairs = require('nvim-autopairs')
npairs.setup({map_cr=false})
_G.MUtils= {}
MUtils.completion_confirm=function()
if vim.fn["coc#pum#visible"]() ~= 0 then
return vim.fn["coc#pum#confirm"]()
else
return npairs.autopairs_cr()
end
end
remap('i' , '<CR>','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true})

View file

@ -19,8 +19,8 @@ in {
xdg.configFile = {
"nvim/coc-settings.json".source = pkgs.writeText "coc-settings.json" ''
{
"java.jdt.ls.java.home": "${pkgs.temurin-bin-18}",
"colors.enable": true,
"coc.preferences.formatOnType": true,
"Lua.misc.parameters": [
"--metapath",
"~/.cache/sumneko_lua/meta",
@ -28,6 +28,7 @@ in {
"~/.cache/sumneko_lua/log"
],
"sumneko-lua.serverDir": "${pkgs.lua-language-server}/share/lua-language-server",
"java.jdt.ls.java.home": "${pkgs.temurin-bin-18}",
"bashIde.shellcheckPath": "${pkgs.shellcheck}/bin/shellcheck"
}
'';
@ -67,7 +68,6 @@ in {
coc-sumneko-lua
coc-highlight
coc-json
coc-pairs
coc-pyright
coc-sh
coc-snippets
@ -75,6 +75,7 @@ in {
coc-yaml
coc-toml
coc-markdownlint
coc-tsserver
coc-fzf
(plugin "junegunn/fzf.vim")
@ -95,6 +96,7 @@ in {
(plugin "MunifTanjim/nui.nvim")
# to explore more
nvim-autopairs
(plugin "sindrets/diffview.nvim")
(plugin "folke/todo-comments.nvim")
(plugin "petertriho/nvim-scrollbar")