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