Update config, add new plugins

This commit is contained in:
2025-01-24 14:44:27 +01:00
parent 9732e4ae16
commit 10e3c9df3e
6 changed files with 83 additions and 59 deletions

View File

@@ -14,8 +14,8 @@ end
-- Move lines up and down
vim.api.nvim_set_keymap('n', '<A-Up>', ':m .-2<CR>==', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-Down>', ':m .+1<CR>==', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-k>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-j>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-k>', '<Esc>:m .-2<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<A-j>', '<Esc>:m .+1<CR>', { noremap = true, silent = true })
-- Move lines in insert mode
vim.api.nvim_set_keymap('i', '<A-Up>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })

View File

@@ -3,12 +3,13 @@ return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer", -- source for text in buffer
"hrsh7th/cmp-path", -- source for file system paths
"L3MON4D3/LuaSnip", -- snippet engine
"saadparwaiz1/cmp_luasnip", -- for autocompletion
"rafamadriz/friendly-snippets", -- useful snippets
"onsails/lspkind.nvim", -- icons for cmp
{ "hrsh7th/cmp-buffer" }, -- source for text in buffer
{ "hrsh7th/cmp-path" }, -- source for file system paths
{ "L3MON4D3/LuaSnip" }, -- snippet engine
{ "saadparwaiz1/cmp_luasnip" }, -- for autocompletion
{ "rafamadriz/friendly-snippets" }, -- useful snippets
{ "onsails/lspkind.nvim" }, -- icons for cmp
{ "hrsh7th/cmp-nvim-lsp-signature-help" }, -- signature help
},
config = function()
@@ -18,9 +19,9 @@ return {
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load({paths = "~/projects/dotfiles/config/.config/VSCodium/User/snippets"})
require("luasnip.loaders.from_vscode").load({paths = { "~/.config/nvim/my_snippets" }})
luasnip.filetype_extend("htmldjango", { "html" })
-- luasnip.filetype_extend("htmldjango", { "html" })
cmp.setup({
completion = {
@@ -72,6 +73,7 @@ return {
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
{ name = 'nvim_lsp_signature_help' }, -- signature help
}),
formatting = {
@@ -98,6 +100,7 @@ return {
vim.keymap.set({ "i", "s" }, "<C-w>", function()
luasnip.jump(1)
end, opts)
opts.desc = "previous snippet placeholder"
vim.keymap.set({ "i", "s" }, "<C-b>", function()
luasnip.jump(-1)

12
nvim/lua/plugins/grammar.lua Executable file
View File

@@ -0,0 +1,12 @@
return {
"kikofmas/grammarous.nvim",
config = function ()
local keymap = vim.keymap
local opts = require('utils').opts
keymap.set('n', '<leader>sl', ':GrammarousCheck<CR>', opts('LanguageTool Spell Checker'))
keymap.set('n', '<leader>sc', ':GrammarousCheck --comments-only<CR>', opts('LanguageTool Spell Checker, only comments'))
keymap.set('n', '<leader>ss', ':set spell<CR>', opts('Start built-in spell checker'))
keymap.set('n', '<leader>sn', ':set nospell<CR>', opts('Stop spell checker'))
end
}

View File

@@ -100,6 +100,11 @@ return {
on_attach = on_attach,
})
lspconfig.html.setup({
capabilities = capabilities,
on_attach = on_attach,
})
lspconfig.lua_ls.setup({
capabilities = capabilities,
on_attach = on_attach,
@@ -130,6 +135,12 @@ return {
on_attach = on_attach,
})
lspconfig.volar.setup({
capabilities = capabilities,
on_attach = on_attach,
cmd = { "vue-language-server", "--stdio" }
})
-- done in ftplugin
lspconfig.jdtls.setup({
capabilities = capabilities,