Compare commits
4 Commits
4d6a5a431c
...
4aa0c54fc4
Author | SHA1 | Date | |
---|---|---|---|
4aa0c54fc4 | |||
5870ed5fc5 | |||
1805645694 | |||
d134abbfda |
@ -12,34 +12,32 @@ end
|
|||||||
|
|
||||||
-- Handy VSCode Shortcuts
|
-- Handy VSCode Shortcuts
|
||||||
-- Move lines up and down
|
-- 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-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-Down>", ":m .+1<CR>==", { 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-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 })
|
vim.api.nvim_set_keymap("n", "<A-j>", "<Esc>:m .+1<CR>", { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Move lines in insert mode
|
-- Move lines in insert mode
|
||||||
vim.api.nvim_set_keymap('i', '<A-Up>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("i", "<A-Up>", "<Esc>:m .-2<CR>i", { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('i', '<A-Down>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("i", "<A-Down>", "<Esc>:m .+1<CR>i", { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('i', '<A-k>', '<Esc>:m .-2<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("i", "<A-k>", "<Esc>:m .-2<CR>i", { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('i', '<A-j>', '<Esc>:m .+1<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("i", "<A-j>", "<Esc>:m .+1<CR>i", { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Copy lines up and down in normal mode
|
-- Copy lines up and down in normal mode
|
||||||
vim.api.nvim_set_keymap('n', '<C-A-S-Up>', ':t .-1<CR>', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("n", "<C-A-S-Up>", ":t .-1<CR>", { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('n', '<C-A-S-Down>', ':t .-1<CR>', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("n", "<C-A-S-Down>", ":t .-1<CR>", { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('n', '<C-A-S-k>', ':t .-1<CR>', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("n", "<C-A-S-k>", ":t .-1<CR>", { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('n', '<C-A-S-j>', ':t .<CR>', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("n", "<C-A-S-j>", ":t .<CR>", { noremap = true, silent = true })
|
||||||
|
|
||||||
-- Copy lines up and down in insert mode
|
-- Copy lines up and down in insert mode
|
||||||
vim.api.nvim_set_keymap('i', '<C-A-S-Up>', '<Esc>:t.-1<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("i", "<C-A-S-Up>", "<Esc>:t.-1<CR>i", { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('i', '<C-A-S-Down>', '<Esc>:t.<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("i", "<C-A-S-Down>", "<Esc>:t.<CR>i", { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('i', '<C-A-S-k>', '<Esc>:t.-1<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("i", "<C-A-S-k>", "<Esc>:t.-1<CR>i", { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('i', '<C-A-S-j>', '<Esc>:t.<CR>i', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("i", "<C-A-S-j>", "<Esc>:t.<CR>i", { noremap = true, silent = true })
|
||||||
|
|
||||||
|
|
||||||
-- Keep selection in visual mode when indenting
|
-- Keep selection in visual mode when indenting
|
||||||
vim.api.nvim_set_keymap('v', '<', '<gv', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("v", "<", "<gv", { noremap = true, silent = true })
|
||||||
vim.api.nvim_set_keymap('v', '>', '>gv', { noremap = true, silent = true })
|
vim.api.nvim_set_keymap("v", ">", ">gv", { noremap = true, silent = true })
|
||||||
|
|
||||||
|
|
||||||
-- Save and quit (sudo and no sudo)
|
-- Save and quit (sudo and no sudo)
|
||||||
keymap.set("n", "E", ":wq!<CR>", opts("write and quit file"))
|
keymap.set("n", "E", ":wq!<CR>", opts("write and quit file"))
|
||||||
@ -55,12 +53,12 @@ keymap.set("n", "<leader>dd", ":t.<CR>", opts("Duplicate line"))
|
|||||||
keymap.set("n", "<C-b>", ":wincmd p<CR>", opts("Cycle focus"))
|
keymap.set("n", "<C-b>", ":wincmd p<CR>", opts("Cycle focus"))
|
||||||
|
|
||||||
-- Key Mappings for LaTeX workflow
|
-- Key Mappings for LaTeX workflow
|
||||||
keymap.set('n', '<leader>lc', ':VimtexCompile<CR>', opts("Compile latex document")) -- Compile LaTeX file
|
keymap.set("n", "<leader>lc", ":VimtexCompile<CR>", opts("Compile latex document")) -- Compile LaTeX file
|
||||||
keymap.set('n', '<leader>lv', ':VimtexView<CR>', opts("View compiled latex pdf")) -- View compiled PDF
|
keymap.set("n", "<leader>lv", ":VimtexView<CR>", opts("View compiled latex pdf")) -- View compiled PDF
|
||||||
keymap.set('n', '<leader>lq', ':VimtexStop<CR>', opts("Stop Compiling document")) -- Stop compilation
|
keymap.set("n", "<leader>lq", ":VimtexStop<CR>", opts("Stop Compiling document")) -- Stop compilation
|
||||||
|
|
||||||
-- Markdown-Preview
|
-- Markdown-Preview
|
||||||
keymap.set('n', '<leader><leader>m', ':MarkdownPreview<CR>', opts("Preview Markdown document in browser")) -- Stop compilation
|
keymap.set("n", "<leader><leader>m", ":MarkdownPreview<CR>", opts("Preview Markdown document in browser")) -- Stop compilation
|
||||||
|
|
||||||
-- window navigation
|
-- window navigation
|
||||||
keymap.set("n", "<A-h>", "<C-w>h", opts())
|
keymap.set("n", "<A-h>", "<C-w>h", opts())
|
||||||
@ -87,8 +85,18 @@ keymap.set("n", "<leader><leader>r", ":!%:p", opts("run current file with argume
|
|||||||
keymap.set("n", "<leader>m", ":!chmod +x %:p<CR>", opts("make current file executable"))
|
keymap.set("n", "<leader>m", ":!chmod +x %:p<CR>", opts("make current file executable"))
|
||||||
|
|
||||||
-- script setup
|
-- script setup
|
||||||
keymap.set("n", "<leader>#", ":w<CR>:!chmod +x %:p<CR>ggi#!/bin/sh<CR><CR><Esc>:setfiletype bash<CR>", opts("setup sh script"))
|
keymap.set(
|
||||||
keymap.set("n", "<leader><leader>#", ":set syntax=python<CR>:w<CR>:!chmod +x %:p<CR>:LspStart pyright<CR>i#!/usr/bin/env python3<CR><CR>", opts("setup python script"))
|
"n",
|
||||||
|
"<leader>#",
|
||||||
|
":w<CR>:!chmod +x %:p<CR>ggi#!/bin/sh<CR><CR><Esc>:setfiletype bash<CR>",
|
||||||
|
opts("setup sh script")
|
||||||
|
)
|
||||||
|
keymap.set(
|
||||||
|
"n",
|
||||||
|
"<leader><leader>#",
|
||||||
|
":set syntax=python<CR>:w<CR>:!chmod +x %:p<CR>:LspStart pyright<CR>i#!/usr/bin/env python3<CR><CR>",
|
||||||
|
opts("setup python script")
|
||||||
|
)
|
||||||
|
|
||||||
-- select all
|
-- select all
|
||||||
keymap.set("n", "<leader>a", "ggVG", opts("select all"))
|
keymap.set("n", "<leader>a", "ggVG", opts("select all"))
|
||||||
@ -103,8 +111,23 @@ keymap.set("i", "<C-e>", "<C-Right>", opts("Jump back by word"))
|
|||||||
keymap.set("i", "<C-$>", "<End>", opts("Jump to EOL"))
|
keymap.set("i", "<C-$>", "<End>", opts("Jump to EOL"))
|
||||||
keymap.set("i", "<C-0>", "<Home>", opts("Jump to beginning of line"))
|
keymap.set("i", "<C-0>", "<Home>", opts("Jump to beginning of line"))
|
||||||
|
|
||||||
-- open in neovide
|
-- Spell checking
|
||||||
-- keymap.set("n", "<leader>n", ":!neovide --no-fork %:p<CR>", opts("open in neovide (wip)"))
|
function StopTextlsp()
|
||||||
|
local clients = vim.lsp.get_clients()
|
||||||
|
for client in clients do
|
||||||
|
if client.name == "textlsp" then
|
||||||
|
vim.lsp.stop_client(client.id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
keymap.set("n", "<leader>sr", ':lua vim.lsp.enable("textlsp")<CR>', opts("Start textlsp"))
|
||||||
|
keymap.set("n", "<leader>sq", StopTextlsp, opts("Stop textlsp"))
|
||||||
|
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"))
|
||||||
|
keymap.set("n", "<leader>slu", ":set spelllang=en_us<CR>", opts("Set spell checker lang to en_US"))
|
||||||
|
keymap.set("n", "<leader>sle", ":set spelllang=en_gb<CR>", opts("Set spell checker lang to en_GB"))
|
||||||
|
keymap.set("n", "<leader>slc", ":set spelllang=de_ch<CR>", opts("Set spell checker lang to de_CH"))
|
||||||
|
|
||||||
-- deleting doesn't yank except when used with <leader>
|
-- deleting doesn't yank except when used with <leader>
|
||||||
keymap.set({ "n", "v" }, "d", '"_d', opts())
|
keymap.set({ "n", "v" }, "d", '"_d', opts())
|
||||||
@ -127,4 +150,9 @@ keymap.set({ "n", "v" }, "<leader><leader>D", '"+D', opts("YANK to system clipbo
|
|||||||
keymap.set("n", "<leader>wk", ":WhichKey<CR>", opts("Toggle WhichKey"))
|
keymap.set("n", "<leader>wk", ":WhichKey<CR>", opts("Toggle WhichKey"))
|
||||||
|
|
||||||
-- Toggle relative line numbers
|
-- Toggle relative line numbers
|
||||||
keymap.set( 'n', '<leader>.', ':lua vim.wo.relativenumber = not vim.wo.relativenumber', opts( 'Toggle relative line numbers' ))
|
keymap.set(
|
||||||
|
"n",
|
||||||
|
"<leader>.",
|
||||||
|
":lua vim.wo.relativenumber = not vim.wo.relativenumber",
|
||||||
|
opts("Toggle relative line numbers")
|
||||||
|
)
|
||||||
|
@ -11,16 +11,15 @@ if not vim.loop.fs_stat(lazypath) then
|
|||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
{ import = "plugins.nav" },
|
{ import = "plugins.nav" },
|
||||||
{ import = "plugins.lsp" },
|
{ import = "plugins.lsp" },
|
||||||
{ import = "plugins.style" },
|
{ import = "plugins.style" },
|
||||||
{ import = "plugins.util" },
|
{ import = "plugins.util" },
|
||||||
{ import = "plugins.testing" }
|
{ import = "plugins.testing" },
|
||||||
},
|
},
|
||||||
change_detection = {
|
change_detection = {
|
||||||
notify = false, -- dont notify when plugins are changed
|
notify = false, -- dont notify when plugins are changed
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
@ -16,8 +16,8 @@ vim.opt.breakindent = true
|
|||||||
vim.opt.linebreak = true
|
vim.opt.linebreak = true
|
||||||
|
|
||||||
-- folding
|
-- folding
|
||||||
vim.wo.foldmethod = 'expr'
|
vim.wo.foldmethod = "expr"
|
||||||
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||||
|
|
||||||
-- line numbers
|
-- line numbers
|
||||||
vim.wo.number = true
|
vim.wo.number = true
|
||||||
|
@ -86,7 +86,7 @@ return {
|
|||||||
-- Otherwise, fallback (insert a tab character)
|
-- Otherwise, fallback (insert a tab character)
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" })
|
end, { "i", "s" }),
|
||||||
}),
|
}),
|
||||||
|
|
||||||
-- sources for autocompletion
|
-- sources for autocompletion
|
||||||
@ -95,7 +95,7 @@ return {
|
|||||||
{ name = "luasnip" }, -- snippets
|
{ name = "luasnip" }, -- snippets
|
||||||
{ name = "buffer" }, -- text within current buffer
|
{ name = "buffer" }, -- text within current buffer
|
||||||
{ name = "path" }, -- file system paths
|
{ name = "path" }, -- file system paths
|
||||||
{ name = 'nvim_lsp_signature_help' }, -- signature help
|
{ name = "nvim_lsp_signature_help" }, -- signature help
|
||||||
}),
|
}),
|
||||||
|
|
||||||
formatting = {
|
formatting = {
|
||||||
|
17
nvim/lua/plugins/lsp/ls/bashls.lua
Normal file
17
nvim/lua/plugins/lsp/ls/bashls.lua
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ Bash │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
lsp.config("bashls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("bashls")
|
28
nvim/lua/plugins/lsp/ls/c.lua
Normal file
28
nvim/lua/plugins/lsp/ls/c.lua
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ C, Cpp, objc │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
lsp.config("clangd", {
|
||||||
|
cmd = {
|
||||||
|
"clangd",
|
||||||
|
"--suggest-missing-includes",
|
||||||
|
"--clang-tidy",
|
||||||
|
},
|
||||||
|
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "ino" },
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
lsp.config("cmake", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("clangd")
|
||||||
|
enable("cmake")
|
17
nvim/lua/plugins/lsp/ls/go.lua
Normal file
17
nvim/lua/plugins/lsp/ls/go.lua
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ GO │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
lsp.config("gopls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("gopls")
|
17
nvim/lua/plugins/lsp/ls/hypr.lua
Normal file
17
nvim/lua/plugins/lsp/ls/hypr.lua
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ Hyprland │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
lsp.config("hyprls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("hyprls")
|
45
nvim/lua/plugins/lsp/ls/low-level.lua
Normal file
45
nvim/lua/plugins/lsp/ls/low-level.lua
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ Low-level (HDL and ASM) │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
-- ┌ ┐
|
||||||
|
-- │ ASM │
|
||||||
|
-- └ ┘
|
||||||
|
lsp.config("asm_lsp", {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ┌ ┐
|
||||||
|
-- │ Verilog │
|
||||||
|
-- └ ┘
|
||||||
|
local lspconfutil = require("lspconfig/util")
|
||||||
|
local root_pattern = lspconfutil.root_pattern("veridian.yml", ".git", ".xpr")
|
||||||
|
local verilog_root_dir = function()
|
||||||
|
local filename = lspconfutil.path.join(vim.loop.cwd(), fname)
|
||||||
|
return root_pattern(filename) or lspconfutil.path.dirname(filename)
|
||||||
|
end
|
||||||
|
lsp.config("veridian", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
root_dir = verilog_root_dir,
|
||||||
|
})
|
||||||
|
|
||||||
|
lsp.config("verible", {
|
||||||
|
-- cmd = { 'verible-verilog-ls', '--rules_config=/home/janis/.config/nvim/util/verible-conf.json' },
|
||||||
|
cmd = { "verible-verilog-ls", "--rules=-no-trailing-spaces", "" },
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
root_dir = verilog_root_dir,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("veridian")
|
||||||
|
enable("verible")
|
||||||
|
enable("asm_lsp")
|
32
nvim/lua/plugins/lsp/ls/luals.lua
Normal file
32
nvim/lua/plugins/lsp/ls/luals.lua
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ LUA │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
lsp.config("lua_ls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
-- make the language server recognize "vim" global
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
-- make language server aware of runtime files
|
||||||
|
library = {
|
||||||
|
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||||
|
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("lua_ls")
|
17
nvim/lua/plugins/lsp/ls/pyright.lua
Normal file
17
nvim/lua/plugins/lsp/ls/pyright.lua
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ Python │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
lsp.config("pyright", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("pyright")
|
17
nvim/lua/plugins/lsp/ls/ruby.lua
Normal file
17
nvim/lua/plugins/lsp/ls/ruby.lua
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ Ruby │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
lsp.config("ruby_lsp", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("ruby_lsp")
|
24
nvim/lua/plugins/lsp/ls/rust-analyzer.lua
Normal file
24
nvim/lua/plugins/lsp/ls/rust-analyzer.lua
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ Rust │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
lsp.config("rust_analyzer", {
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
diagnostics = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("rust_analyzer")
|
36
nvim/lua/plugins/lsp/ls/text.lua
Normal file
36
nvim/lua/plugins/lsp/ls/text.lua
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ Text languages (TeX and MD) │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
-- ┌ ┐
|
||||||
|
-- │ Markdown │
|
||||||
|
-- └ ┘
|
||||||
|
lsp.config("marksman", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ┌ ┐
|
||||||
|
-- │ LaTeX │
|
||||||
|
-- └ ┘
|
||||||
|
lsp.config("texlab", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ┌ ┐
|
||||||
|
-- │ Spell checking │
|
||||||
|
-- └ ┘
|
||||||
|
lsp.config("textlsp", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("marksman")
|
||||||
|
enable("texlab")
|
69
nvim/lua/plugins/lsp/ls/web.lua
Normal file
69
nvim/lua/plugins/lsp/ls/web.lua
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ Web technology │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
-- ┌ ┐
|
||||||
|
-- │ HTML, CSS, JSON │
|
||||||
|
-- └ ┘
|
||||||
|
lsp.config("cssls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
lsp.config("html", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
lsp.config("jsonls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ┌ ┐
|
||||||
|
-- │ Vue │
|
||||||
|
-- └ ┘
|
||||||
|
lsp.config("vue_ls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
filetypes = {
|
||||||
|
"vue",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ┌ ┐
|
||||||
|
-- │ TS, JS, TSX, JSX │
|
||||||
|
-- └ ┘
|
||||||
|
lsp.config("ts_ls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
init_options = {
|
||||||
|
plugins = {
|
||||||
|
{
|
||||||
|
name = "@vue/typescript-plugin",
|
||||||
|
location = "/usr/lib/node_modules/@vue/typescript-plugin",
|
||||||
|
languages = { "javascript", "typescript", "vue" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filetypes = {
|
||||||
|
"javascript",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"javascriptreact",
|
||||||
|
"vue",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("jsonls")
|
||||||
|
enable("html")
|
||||||
|
enable("css")
|
||||||
|
enable("vue_ls")
|
||||||
|
enable("ts_ls")
|
@ -1,3 +1,7 @@
|
|||||||
|
-- ───────────────────────────────────────────────────────────────────
|
||||||
|
-- ╭───────────────────────────────────────────────╮
|
||||||
|
-- │ LSP Configuration │
|
||||||
|
-- ╰───────────────────────────────────────────────╯
|
||||||
return {
|
return {
|
||||||
-- lsp configuration
|
-- lsp configuration
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
@ -8,12 +12,8 @@ return {
|
|||||||
"mfussenegger/nvim-jdtls",
|
"mfussenegger/nvim-jdtls",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local lsp = vim.lsp
|
|
||||||
local enable = vim.lsp.enable
|
local enable = vim.lsp.enable
|
||||||
|
|
||||||
local capabilities = require("lsp-options").capabilities
|
|
||||||
local on_attach = require("lsp-options").on_attach
|
|
||||||
|
|
||||||
-- Change the Diagnostic symbols in the sign column (gutter)
|
-- Change the Diagnostic symbols in the sign column (gutter)
|
||||||
local signs = { Error = " ", Warn = " ", Hint = "", Info = " " }
|
local signs = { Error = " ", Warn = " ", Hint = "", Info = " " }
|
||||||
for type, icon in pairs(signs) do
|
for type, icon in pairs(signs) do
|
||||||
@ -21,189 +21,22 @@ return {
|
|||||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- ┌ ┐
|
-- ───────────────────────────────────────────────────────────────────
|
||||||
-- │ Bash │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("bashls", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ C, Cpp, objc │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("clangd", {
|
|
||||||
cmd = {
|
|
||||||
"clangd",
|
|
||||||
"--suggest-missing-includes",
|
|
||||||
"--clang-tidy",
|
|
||||||
},
|
|
||||||
filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto", "ino" },
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ Rust │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("rust_analyzer", {
|
|
||||||
settings = {
|
|
||||||
["rust-analyzer"] = {
|
|
||||||
diagnostics = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ HTML, CSS, JSON │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("cssls", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
lsp.config("html", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
lsp.config("jsonls", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ LUA │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("lua_ls", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
-- make the language server recognize "vim" global
|
|
||||||
diagnostics = {
|
|
||||||
globals = { "vim" },
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
-- make language server aware of runtime files
|
|
||||||
library = {
|
|
||||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
|
||||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ Markdown │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("marksman", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ Python │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("pyright", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ Vue │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("vue_ls", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
filetypes = {
|
|
||||||
"vue",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ TS, JS, TSX, JSX │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("ts_ls", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
init_options = {
|
|
||||||
plugins = {
|
|
||||||
{
|
|
||||||
name = "@vue/typescript-plugin",
|
|
||||||
location = "/usr/lib/node_modules/@vue/typescript-plugin",
|
|
||||||
languages = { "javascript", "typescript", "vue" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
filetypes = {
|
|
||||||
"javascript",
|
|
||||||
"typescript",
|
|
||||||
"typescriptreact",
|
|
||||||
"javascriptreact",
|
|
||||||
"vue",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ ASM │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("asm_lsp", {
|
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ LaTeX │
|
|
||||||
-- └ ┘
|
|
||||||
lsp.config("texlab", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ┌ ┐
|
|
||||||
-- │ Verilog │
|
|
||||||
-- └ ┘
|
|
||||||
local lspconfutil = require("lspconfig/util")
|
|
||||||
local root_pattern = lspconfutil.root_pattern("veridian.yml", ".git", ".xpr")
|
|
||||||
local verilog_root_dir = function()
|
|
||||||
local filename = lspconfutil.path.join(vim.loop.cwd(), fname)
|
|
||||||
return root_pattern(filename) or lspconfutil.path.dirname(filename)
|
|
||||||
end
|
|
||||||
lsp.config("veridian", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
root_dir = verilog_root_dir,
|
|
||||||
})
|
|
||||||
|
|
||||||
lsp.config("verible", {
|
|
||||||
-- cmd = { 'verible-verilog-ls', '--rules_config=/home/janis/.config/nvim/util/verible-conf.json' },
|
|
||||||
cmd = { "verible-verilog-ls", "--rules=-no-trailing-spaces", "" },
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
root_dir = verilog_root_dir,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- ╭───────────────────────────────────────────────╮
|
-- ╭───────────────────────────────────────────────╮
|
||||||
-- │ Enable the configs │
|
-- │ Import configs from other files │
|
||||||
-- ╰───────────────────────────────────────────────╯
|
-- ╰───────────────────────────────────────────────╯
|
||||||
enable("bashls")
|
require("plugins.lsp.ls.bashls")
|
||||||
enable("clangd")
|
require("plugins.lsp.ls.c")
|
||||||
enable("rust_analyzer")
|
require("plugins.lsp.ls.go")
|
||||||
enable("marksman")
|
require("plugins.lsp.ls.hypr")
|
||||||
enable("vue_ls")
|
require("plugins.lsp.ls.low-level")
|
||||||
enable("ts_ls")
|
require("plugins.lsp.ls.luals")
|
||||||
enable("texlab")
|
require("plugins.lsp.ls.pyright")
|
||||||
enable("asm_lsp")
|
require("plugins.lsp.ls.rust-analyzer")
|
||||||
enable("jsonls")
|
require("plugins.lsp.ls.ruby")
|
||||||
enable("cssls")
|
require("plugins.lsp.ls.text")
|
||||||
enable("html")
|
require("plugins.lsp.ls.web")
|
||||||
enable("lua_ls")
|
-- ───────────────────────────────────────────────────────────────────
|
||||||
enable("pyright")
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
-- ───────────────────────────────────────────────────────────────────
|
||||||
|
@ -1,12 +1,3 @@
|
|||||||
return {
|
return {
|
||||||
'L3MON4D3/LuaSnip',
|
"L3MON4D3/LuaSnip",
|
||||||
-- config = function()
|
|
||||||
-- local luasnip = require('luasnip')
|
|
||||||
-- -- luasnip.setup({
|
|
||||||
-- -- region_check_events = "CursorMoved",
|
|
||||||
-- -- delete_check_events = "TextChanged",
|
|
||||||
-- -- })
|
|
||||||
--
|
|
||||||
-- require("luasnip.loaders.from_vscode").load({paths = "~/.config/nvim/my_snippets"})
|
|
||||||
-- end
|
|
||||||
}
|
}
|
||||||
|
@ -26,15 +26,21 @@ return {
|
|||||||
-- list of servers for mason to install
|
-- list of servers for mason to install
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"asm-lsp",
|
"asm-lsp",
|
||||||
-- "bashls",
|
"bashls",
|
||||||
-- "clangd",
|
"clangd",
|
||||||
|
"cmake",
|
||||||
-- "cssls",
|
-- "cssls",
|
||||||
|
"dartls",
|
||||||
|
"gopls",
|
||||||
|
"hyprls",
|
||||||
"jdtls",
|
"jdtls",
|
||||||
"marksman",
|
"marksman",
|
||||||
-- "lua_ls",
|
-- "lua_ls",
|
||||||
-- "pyright",
|
-- "pyright",
|
||||||
"rust_analyzer",
|
"rust_analyzer",
|
||||||
-- "tsserver",
|
"ruby_lsp",
|
||||||
|
-- "ts_ls",
|
||||||
|
"textlsp",
|
||||||
"vue_ls"
|
"vue_ls"
|
||||||
},
|
},
|
||||||
-- auto-install configured servers (with lspconfig)
|
-- auto-install configured servers (with lspconfig)
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ Formatting, diagnostics │
|
||||||
|
-- └ ┘
|
||||||
return {
|
return {
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvimtools/none-ls-extras.nvim'
|
"nvimtools/none-ls-extras.nvim",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local null_ls = require("null-ls")
|
local null_ls = require("null-ls")
|
||||||
@ -46,9 +49,9 @@ return {
|
|||||||
null_ls.builtins.formatting.shfmt,
|
null_ls.builtins.formatting.shfmt,
|
||||||
null_ls.builtins.formatting.asmfmt,
|
null_ls.builtins.formatting.asmfmt,
|
||||||
null_ls.builtins.code_actions.proselint,
|
null_ls.builtins.code_actions.proselint,
|
||||||
require( 'none-ls.diagnostics.eslint_d' ),
|
require("none-ls.diagnostics.eslint_d"),
|
||||||
require( 'none-ls.code_actions.eslint_d' ),
|
require("none-ls.code_actions.eslint_d"),
|
||||||
require( 'none-ls.formatting.eslint_d' ),
|
require("none-ls.formatting.eslint_d"),
|
||||||
null_ls.builtins.formatting.black,
|
null_ls.builtins.formatting.black,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -41,13 +41,13 @@ return {
|
|||||||
"vue",
|
"vue",
|
||||||
"xml",
|
"xml",
|
||||||
"yaml",
|
"yaml",
|
||||||
"zathurarc"
|
"zathurarc",
|
||||||
},
|
},
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
|
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
disable = { "tex" }
|
disable = { "tex" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
@ -2,14 +2,14 @@ return {
|
|||||||
"lervag/vimtex",
|
"lervag/vimtex",
|
||||||
config = function()
|
config = function()
|
||||||
-- vimtex settings
|
-- vimtex settings
|
||||||
-- vim.g.vimtex_view_method = 'startup' -- PDF viewer (example: zathura, or use 'skim' for macOS)
|
-- vim.g.vimtex_view_method = 'zathura' -- PDF viewer (example: zathura, or use 'skim' for macOS)
|
||||||
vim.g.vimtex_compiler_method = 'latexmk' -- Use latexmk for compilation
|
vim.g.vimtex_compiler_method = "latexmk" -- Use latexmk for compilation
|
||||||
vim.g.vimtex_fold_enabled = 1 -- Enable folding for LaTeX sections
|
vim.g.vimtex_fold_enabled = 1 -- Enable folding for LaTeX sections
|
||||||
vim.g.vimtex_quickfix_mode = 0 -- Disable quickfix mode for compilation errors
|
vim.g.vimtex_quickfix_mode = 0 -- Disable quickfix mode for compilation errors
|
||||||
-- Key Mappings for LaTeX workflow
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>lc', ':VimtexCompile<CR>', {}) -- Compile LaTeX file
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>lv', ':VimtexView<CR>', {}) -- View compiled PDF
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>lq', ':VimtexStop<CR>', {}) -- Stop compilation
|
|
||||||
|
|
||||||
end
|
-- ── Key Mappings for LaTeX workflow ──────────────────────────────
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>lc", ":VimtexCompile<CR>", {}) -- Compile LaTeX file
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>lv", ":VimtexView<CR>", {}) -- View compiled PDF
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>lq", ":VimtexStop<CR>", {}) -- Stop compilation
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
return {
|
return {
|
||||||
"echasnovski/mini.bufremove",
|
"echasnovski/mini.bufremove",
|
||||||
config = function()
|
config = function()
|
||||||
_G.MiniBufremove = require( 'mini.bufremove' );
|
_G.MiniBufremove = require("mini.bufremove")
|
||||||
vim.keymap.set( 'n', '<C-x>', ':lua MiniBufremove.delete()<CR>', { silent = true, noremap = true, desc = 'Remove buffer' } );
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
"<C-x>",
|
||||||
|
":lua MiniBufremove.delete()<CR>",
|
||||||
|
{ silent = true, noremap = true, desc = "Remove buffer" }
|
||||||
|
)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
-- open file at previous position
|
-- open file at previous position
|
||||||
'ethanholz/nvim-lastplace',
|
"ethanholz/nvim-lastplace",
|
||||||
config = function()
|
config = function()
|
||||||
require('nvim-lastplace').setup{}
|
require("nvim-lastplace").setup({})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -141,6 +141,6 @@ return {
|
|||||||
custom_hl_group = nil, -- "Visual" or any other hl group to use instead of inverted colors
|
custom_hl_group = nil, -- "Visual" or any other hl group to use instead of inverted colors
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" })
|
vim.keymap.set("n", "<leader><leader>n", ":Navbuddy<CR>", { silent = true, desc = "open navbuddy menu" })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ return {
|
|||||||
},
|
},
|
||||||
nesting_rules = {},
|
nesting_rules = {},
|
||||||
filesystem = {
|
filesystem = {
|
||||||
scan_mode = 'deep',
|
scan_mode = "deep",
|
||||||
filtered_items = {
|
filtered_items = {
|
||||||
visible = false, -- when true, they will just be displayed differently than normal items
|
visible = false, -- when true, they will just be displayed differently than normal items
|
||||||
hide_dotfiles = true,
|
hide_dotfiles = true,
|
||||||
|
@ -35,34 +35,34 @@ return {
|
|||||||
|
|
||||||
-- Recent Commands
|
-- Recent Commands
|
||||||
opts.desc = "Show recent commands"
|
opts.desc = "Show recent commands"
|
||||||
vim.keymap.set('n', '<leader>frc', ':Telescope command_history<CR>', opts)
|
vim.keymap.set("n", "<leader>frc", ":Telescope command_history<CR>", opts)
|
||||||
|
|
||||||
-- Recent Searches
|
-- Recent Searches
|
||||||
opts.desc = "Show recent searches"
|
opts.desc = "Show recent searches"
|
||||||
vim.keymap.set('n', '<leader>frs', ':Telescope search_history<CR>', opts)
|
vim.keymap.set("n", "<leader>frs", ":Telescope search_history<CR>", opts)
|
||||||
|
|
||||||
-- Old Files
|
-- Old Files
|
||||||
opts.desc = "Show recent files"
|
opts.desc = "Show recent files"
|
||||||
vim.keymap.set('n', '<leader>frf', ':Telescope oldfiles<CR>', opts)
|
vim.keymap.set("n", "<leader>frf", ":Telescope oldfiles<CR>", opts)
|
||||||
|
|
||||||
-- Quickfix Items
|
-- Quickfix Items
|
||||||
opts.desc = "Show quickfix items"
|
opts.desc = "Show quickfix items"
|
||||||
vim.keymap.set('n', '<leader>fq', ':Telescope quickfix<CR>', opts)
|
vim.keymap.set("n", "<leader>fq", ":Telescope quickfix<CR>", opts)
|
||||||
|
|
||||||
-- Spell Suggestions
|
-- Spell Suggestions
|
||||||
opts.desc = "Show spell suggestions"
|
opts.desc = "Show spell suggestions"
|
||||||
vim.keymap.set('n', '<leader>fs', ':Telescope spell_suggest<CR>', opts)
|
vim.keymap.set("n", "<leader>fs", ":Telescope spell_suggest<CR>", opts)
|
||||||
|
|
||||||
-- Diagnostics
|
-- Diagnostics
|
||||||
opts.desc = "Show diagnostics"
|
opts.desc = "Show diagnostics"
|
||||||
vim.keymap.set('n', '<leader>fd', ':Telescope diagnostics<CR>', opts)
|
vim.keymap.set("n", "<leader>fd", ":Telescope diagnostics<CR>", opts)
|
||||||
|
|
||||||
-- Notifications
|
-- Notifications
|
||||||
opts.desc = "Show notifications"
|
opts.desc = "Show notifications"
|
||||||
vim.keymap.set('n', '<leader>fn', ':Telescope notify<CR>', opts)
|
vim.keymap.set("n", "<leader>fn", ":Telescope notify<CR>", opts)
|
||||||
|
|
||||||
-- Implementations
|
-- Implementations
|
||||||
opts.desc = "Show implementations"
|
opts.desc = "Show implementations"
|
||||||
vim.keymap.set('n', '<leader>fi', ':Telescope lsp_implementations<CR>', opts)
|
vim.keymap.set("n", "<leader>fi", ":Telescope lsp_implementations<CR>", opts)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,5 @@ return {
|
|||||||
vim.o.timeout = true
|
vim.o.timeout = true
|
||||||
vim.o.timeoutlen = 500
|
vim.o.timeoutlen = 500
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {},
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
return {
|
return {
|
||||||
-- colorizes colors in code
|
-- colorizes colors in code
|
||||||
'NvChad/nvim-colorizer.lua' ,
|
"NvChad/nvim-colorizer.lua",
|
||||||
--cmd = 'ColorizerToggle',
|
--cmd = 'ColorizerToggle',
|
||||||
config = function()
|
config = function()
|
||||||
require("colorizer").setup {
|
require("colorizer").setup({
|
||||||
filetypes = { "*" },
|
filetypes = { "*" },
|
||||||
user_default_options = {
|
user_default_options = {
|
||||||
RGB = true, -- #RGB hex codes - #FCE
|
RGB = true, -- #RGB hex codes - #FCE
|
||||||
@ -21,14 +21,14 @@ return {
|
|||||||
-- True is same as normal
|
-- True is same as normal
|
||||||
tailwind = false, -- Enable tailwind colors
|
tailwind = false, -- Enable tailwind colors
|
||||||
-- parsers can contain values used in |user_default_options|
|
-- parsers can contain values used in |user_default_options|
|
||||||
sass = { enable = false, parsers = { "css" }, }, -- Enable sass colors
|
sass = { enable = false, parsers = { "css" } }, -- Enable sass colors
|
||||||
virtualtext = "■",
|
virtualtext = "■",
|
||||||
-- update color values even if buffer is not focused
|
-- update color values even if buffer is not focused
|
||||||
-- example use: cmp_menu, cmp_docs
|
-- example use: cmp_menu, cmp_docs
|
||||||
always_update = false
|
always_update = false,
|
||||||
},
|
},
|
||||||
-- all the sub-options of filetypes apply to buftypes
|
-- all the sub-options of filetypes apply to buftypes
|
||||||
buftypes = {},
|
buftypes = {},
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ return {
|
|||||||
functions = "italic",
|
functions = "italic",
|
||||||
keywords = "italic",
|
keywords = "italic",
|
||||||
types = "italic",
|
types = "italic",
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
palettes = {
|
palettes = {
|
||||||
all = {
|
all = {
|
||||||
@ -77,7 +77,7 @@ return {
|
|||||||
statement = "magenta",
|
statement = "magenta",
|
||||||
string = "cyan",
|
string = "cyan",
|
||||||
type = "red",
|
type = "red",
|
||||||
variable = "orange"
|
variable = "orange",
|
||||||
},
|
},
|
||||||
diag = {
|
diag = {
|
||||||
error = "darkred",
|
error = "darkred",
|
||||||
@ -91,22 +91,22 @@ return {
|
|||||||
warn = "#a16b00",
|
warn = "#a16b00",
|
||||||
info = "cyan",
|
info = "cyan",
|
||||||
hint = "bg3",
|
hint = "bg3",
|
||||||
ok = "green";
|
ok = "green",
|
||||||
},
|
},
|
||||||
diff = {
|
diff = {
|
||||||
add = "darkgreen",
|
add = "darkgreen",
|
||||||
delete = "darkred",
|
delete = "darkred",
|
||||||
changed = "lightblue",
|
changed = "lightblue",
|
||||||
text = "fg0"
|
text = "fg0",
|
||||||
},
|
},
|
||||||
git = {
|
git = {
|
||||||
add = "darkgreen",
|
add = "darkgreen",
|
||||||
removed = "darkred",
|
removed = "darkred",
|
||||||
changed = "lightblue",
|
changed = "lightblue",
|
||||||
conflict = "orange",
|
conflict = "orange",
|
||||||
ignored = "gray"
|
ignored = "gray",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
groups = {
|
groups = {
|
||||||
all = {
|
all = {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
return {
|
return {
|
||||||
-- add comment keybinds
|
-- add comment keybinds
|
||||||
'numToStr/Comment.nvim',
|
"numToStr/Comment.nvim",
|
||||||
opts = {},
|
opts = {},
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
require('Comment').setup()
|
require("Comment").setup()
|
||||||
require('Comment.ft').set('hyprlang', '#%s')
|
require("Comment.ft").set("hyprlang", "#%s")
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
-- prettier prompts
|
-- prettier prompts
|
||||||
'stevearc/dressing.nvim',
|
"stevearc/dressing.nvim",
|
||||||
event = 'VeryLazy',
|
event = "VeryLazy",
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
-- status line
|
-- status line
|
||||||
'nvim-lualine/lualine.nvim',
|
"nvim-lualine/lualine.nvim",
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
config = function()
|
config = function()
|
||||||
local function getWords()
|
local function getWords()
|
||||||
local wc = vim.api.nvim_eval("wordcount()")
|
local wc = vim.api.nvim_eval("wordcount()")
|
||||||
@ -11,45 +11,45 @@ return {
|
|||||||
return wc["words"]
|
return wc["words"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
require('lualine').setup {
|
require("lualine").setup({
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
theme = "auto",
|
theme = "auto",
|
||||||
component_separators = { left = '', right = ''},
|
component_separators = { left = "", right = "" },
|
||||||
section_separators = { left = '', right = ''},
|
section_separators = { left = "", right = "" },
|
||||||
disabled_filetypes = {
|
disabled_filetypes = {
|
||||||
statusline = {},
|
statusline = {},
|
||||||
winbar = {},
|
winbar = {},
|
||||||
},
|
},
|
||||||
ignore_focus = { 'neo-tree' },
|
ignore_focus = { "neo-tree" },
|
||||||
always_divide_middle = true,
|
always_divide_middle = true,
|
||||||
globalstatus = false,
|
globalstatus = false,
|
||||||
refresh = {
|
refresh = {
|
||||||
statusline = 1000,
|
statusline = 1000,
|
||||||
tabline = 1000,
|
tabline = 1000,
|
||||||
winbar = 1000,
|
winbar = 1000,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { { 'mode', separator = { left = '', right = '' }, } },
|
lualine_a = { { "mode", separator = { left = "", right = "" } } },
|
||||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
lualine_b = { "branch", "diff", "diagnostics" },
|
||||||
lualine_c = {'filename'},
|
lualine_c = { "filename" },
|
||||||
lualine_x = { getWords, 'encoding', 'fileformat', 'filetype'},
|
lualine_x = { getWords, "encoding", "fileformat", "filetype" },
|
||||||
lualine_y = { { 'progress', left_padding=0 } },
|
lualine_y = { { "progress", left_padding = 0 } },
|
||||||
lualine_z = { { 'location', separator = { left = '', right = '' }, padding=0} }
|
lualine_z = { { "location", separator = { left = "", right = "" }, padding = 0 } },
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = {},
|
lualine_b = {},
|
||||||
lualine_c = {'filename'},
|
lualine_c = { "filename" },
|
||||||
lualine_x = {'location'},
|
lualine_x = { "location" },
|
||||||
lualine_y = {},
|
lualine_y = {},
|
||||||
lualine_z = {}
|
lualine_z = {},
|
||||||
},
|
},
|
||||||
tabline = {},
|
tabline = {},
|
||||||
winbar = {},
|
winbar = {},
|
||||||
inactive_winbar = {},
|
inactive_winbar = {},
|
||||||
extensions = {}
|
extensions = {},
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,12 @@ return {
|
|||||||
"rcarriga/nvim-notify",
|
"rcarriga/nvim-notify",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require( 'notify' ).setup( {
|
require("notify").setup({
|
||||||
max_width = 80,
|
max_width = 80,
|
||||||
minimum_width = 30,
|
minimum_width = 30,
|
||||||
render = 'wrapped-default', -- default, minimal, simple, compact, wrapped-compact or wrapped-default
|
render = "wrapped-default", -- default, minimal, simple, compact, wrapped-compact or wrapped-default
|
||||||
stages = 'slide', -- fade_in_slide_out, fade, slide, static
|
stages = "slide", -- fade_in_slide_out, fade, slide, static
|
||||||
} );
|
})
|
||||||
require("noice").setup({
|
require("noice").setup({
|
||||||
lsp = {
|
lsp = {
|
||||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||||
|
@ -26,7 +26,7 @@ return {
|
|||||||
[[ ]],
|
[[ ]],
|
||||||
},
|
},
|
||||||
highlight = "String",
|
highlight = "String",
|
||||||
default_color = "#010155"
|
default_color = "#010155",
|
||||||
},
|
},
|
||||||
|
|
||||||
quotes = {
|
quotes = {
|
||||||
@ -43,7 +43,7 @@ return {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
highlight = "String",
|
highlight = "String",
|
||||||
default_color = "#FFFFFF"
|
default_color = "#FFFFFF",
|
||||||
},
|
},
|
||||||
|
|
||||||
old = {
|
old = {
|
||||||
@ -58,12 +58,12 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
mapping_keys = false;
|
mapping_keys = false,
|
||||||
},
|
},
|
||||||
|
|
||||||
colors = {
|
colors = {
|
||||||
background = "#000000",
|
background = "#000000",
|
||||||
folded_section = "#100000"
|
folded_section = "#100000",
|
||||||
},
|
},
|
||||||
|
|
||||||
mappings = {
|
mappings = {
|
||||||
@ -71,7 +71,7 @@ return {
|
|||||||
open_file = "<CR>",
|
open_file = "<CR>",
|
||||||
},
|
},
|
||||||
|
|
||||||
parts = {"title", "quotes", "old"}
|
parts = { "title", "quotes", "old" },
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -48,9 +48,15 @@ return {
|
|||||||
end
|
end
|
||||||
|
|
||||||
vim.fn.sign_define("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = "" })
|
vim.fn.sign_define("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = "" })
|
||||||
vim.fn.sign_define("DapBreakpointCondition", { text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = ""})
|
vim.fn.sign_define(
|
||||||
|
"DapBreakpointCondition",
|
||||||
|
{ text = "●", texthl = "DapBreakpointCondition", linehl = "", numhl = "" }
|
||||||
|
)
|
||||||
vim.fn.sign_define("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = "" })
|
vim.fn.sign_define("DapLogPoint", { text = "◆", texthl = "DapLogPoint", linehl = "", numhl = "" })
|
||||||
vim.fn.sign_define('DapStopped', { text='', texthl='DapStopped', linehl='DapStopped', numhl= 'DapStopped' })
|
vim.fn.sign_define(
|
||||||
|
"DapStopped",
|
||||||
|
{ text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" }
|
||||||
|
)
|
||||||
|
|
||||||
dap.configurations.python = {
|
dap.configurations.python = {
|
||||||
{
|
{
|
||||||
@ -91,7 +97,7 @@ return {
|
|||||||
else
|
else
|
||||||
cb({
|
cb({
|
||||||
type = "executable",
|
type = "executable",
|
||||||
command = vim.fn.stdpath("data") .. '/mason/packages/debugpy/venv/bin/python',
|
command = vim.fn.stdpath("data") .. "/mason/packages/debugpy/venv/bin/python",
|
||||||
args = { "-m", "debugpy.adapter" },
|
args = { "-m", "debugpy.adapter" },
|
||||||
options = {
|
options = {
|
||||||
source_filetype = "python",
|
source_filetype = "python",
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
return {
|
return {
|
||||||
"windwp/nvim-ts-autotag",
|
"windwp/nvim-ts-autotag",
|
||||||
config = function()
|
config = function()
|
||||||
require('nvim-ts-autotag').setup({
|
require("nvim-ts-autotag").setup({
|
||||||
opts = {
|
opts = {
|
||||||
-- Defaults
|
-- Defaults
|
||||||
enable_close = true, -- Auto close tags
|
enable_close = true, -- Auto close tags
|
||||||
enable_rename = true, -- Auto rename pairs of tags
|
enable_rename = true, -- Auto rename pairs of tags
|
||||||
enable_close_on_slash = true -- Auto close on trailing </
|
enable_close_on_slash = true, -- Auto close on trailing </
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,21 @@
|
|||||||
return {
|
return {
|
||||||
'uga-rosa/ccc.nvim',
|
"uga-rosa/ccc.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
local ccc = require( 'ccc' );
|
local ccc = require("ccc")
|
||||||
vim.opt.termguicolors = true;
|
vim.opt.termguicolors = true
|
||||||
ccc.setup({
|
ccc.setup({
|
||||||
highlighter = {
|
highlighter = {
|
||||||
auto_enable = false,
|
auto_enable = false,
|
||||||
lsp = true
|
lsp = true,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
local keymap = vim.keymap
|
local keymap = vim.keymap
|
||||||
keymap.set( 'n', '<leader>cp', '<cmd>CccPick<CR>', { noremap = true, silent = true, desc = "Toggle colour picker" } )
|
keymap.set(
|
||||||
end
|
"n",
|
||||||
|
"<leader>cp",
|
||||||
|
"<cmd>CccPick<CR>",
|
||||||
|
{ noremap = true, silent = true, desc = "Toggle colour picker" }
|
||||||
|
)
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,8 @@ return {
|
|||||||
notification = {
|
notification = {
|
||||||
window = {
|
window = {
|
||||||
winblend = 0,
|
winblend = 0,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
end
|
end,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
return {
|
|
||||||
"kikofmas/grammarous.nvim",
|
|
||||||
config = function ()
|
|
||||||
local keymap = vim.keymap
|
|
||||||
local opts = require('utils').opts
|
|
||||||
|
|
||||||
keymap.set('n', '<leader>sr', ':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'))
|
|
||||||
keymap.set('n', '<leader>slu', ':set spelllang=en_us<CR>', opts('Set spell checker lang to en_US'))
|
|
||||||
keymap.set('n', '<leader>sle', ':set spelllang=en_gb<CR>', opts('Set spell checker lang to en_GB'))
|
|
||||||
keymap.set('n', '<leader>slc', ':set spelllang=de_ch<CR>', opts('Set spell checker lang to de_CH'))
|
|
||||||
end
|
|
||||||
}
|
|
@ -1,9 +1,9 @@
|
|||||||
return {
|
return {
|
||||||
-- indent lines
|
-- indent lines
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
opts = {},
|
opts = {},
|
||||||
main = 'ibl',
|
main = "ibl",
|
||||||
config = function()
|
config = function()
|
||||||
require('ibl').setup()
|
require("ibl").setup()
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,16 @@ return {
|
|||||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||||
ft = { "markdown" },
|
ft = { "markdown" },
|
||||||
build = function(plugin)
|
build = function(plugin)
|
||||||
if vim.fn.executable "npx" then
|
if vim.fn.executable("npx") then
|
||||||
vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install")
|
vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install")
|
||||||
else
|
else
|
||||||
vim.cmd [[Lazy load markdown-preview.nvim]]
|
vim.cmd([[Lazy load markdown-preview.nvim]])
|
||||||
vim.fn["mkdp#util#install"]()
|
vim.fn["mkdp#util#install"]()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
init = function()
|
init = function()
|
||||||
if vim.fn.executable "npx" then vim.g.mkdp_filetypes = { "markdown" } end
|
if vim.fn.executable("npx") then
|
||||||
|
vim.g.mkdp_filetypes = { "markdown" }
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
@ -2,16 +2,16 @@ return {
|
|||||||
"smoka7/multicursors.nvim",
|
"smoka7/multicursors.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvimtools/hydra.nvim',
|
"nvimtools/hydra.nvim",
|
||||||
},
|
},
|
||||||
opts = {},
|
opts = {},
|
||||||
cmd = { 'MCstart', 'MCvisual', 'MCclear', 'MCpattern', 'MCvisualPattern', 'MCunderCursor' },
|
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
mode = { 'v', 'n' },
|
mode = { "v", "n" },
|
||||||
'<leader><leader>c',
|
"<leader><leader>c",
|
||||||
'<cmd>MCstart<cr>',
|
"<cmd>MCstart<cr>",
|
||||||
desc = 'Create a selection for selected text or word under the cursor',
|
desc = "Create a selection for selected text or word under the cursor",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local opts = { noremap = true, silent = true, desc = "Generate docs" }
|
local opts = { noremap = true, silent = true, desc = "Generate docs" }
|
||||||
vim.api.nvim_set_keymap("n", "<leader>gd", ":lua require('neogen').generate()<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>gd", ":lua require('neogen').generate()<CR>", opts)
|
||||||
require( 'neogen' ).setup( {
|
require("neogen").setup({
|
||||||
snippet_engine = "luasnip"
|
snippet_engine = "luasnip",
|
||||||
} );
|
})
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,5 @@ return {
|
|||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-surround").setup()
|
require("nvim-surround").setup()
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
@ -24,30 +24,33 @@ M.sudo_exec = function(cmd, print_output)
|
|||||||
print(out)
|
print(out)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
if print_output then print("\r\n", out) end
|
if print_output then
|
||||||
|
print("\r\n", out)
|
||||||
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
M.sudo_write = function(tmpfile, filepath)
|
M.sudo_write = function(tmpfile, filepath)
|
||||||
if not tmpfile then tmpfile = vim.fn.tempname() end
|
if not tmpfile then
|
||||||
if not filepath then filepath = vim.fn.expand("%") end
|
tmpfile = vim.fn.tempname()
|
||||||
|
end
|
||||||
|
if not filepath then
|
||||||
|
filepath = vim.fn.expand("%")
|
||||||
|
end
|
||||||
if not filepath or #filepath == 0 then
|
if not filepath or #filepath == 0 then
|
||||||
print("E32: No file name")
|
print("E32: No file name")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- `bs=1048576` is equivalent to `bs=1M` for GNU dd or `bs=1m` for BSD dd
|
-- `bs=1048576` is equivalent to `bs=1M` for GNU dd or `bs=1m` for BSD dd
|
||||||
-- Both `bs=1M` and `bs=1m` are non-POSIX
|
-- Both `bs=1M` and `bs=1m` are non-POSIX
|
||||||
local cmd = string.format("dd if=%s of=%s bs=1048576",
|
local cmd = string.format("dd if=%s of=%s bs=1048576", vim.fn.shellescape(tmpfile), vim.fn.shellescape(filepath))
|
||||||
vim.fn.shellescape(tmpfile),
|
|
||||||
vim.fn.shellescape(filepath))
|
|
||||||
-- no need to check error as this fails the entire function
|
-- no need to check error as this fails the entire function
|
||||||
vim.api.nvim_exec(string.format("write! %s", tmpfile), true)
|
vim.api.nvim_exec(string.format("write! %s", tmpfile), true)
|
||||||
if M.sudo_exec(cmd) then
|
if M.sudo_exec(cmd) then
|
||||||
-- refreshes the buffer and prints the "written" message
|
-- refreshes the buffer and prints the "written" message
|
||||||
vim.cmd.checktime()
|
vim.cmd.checktime()
|
||||||
-- exit command mode
|
-- exit command mode
|
||||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(
|
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true)
|
||||||
"<Esc>", true, false, true), "n", true)
|
|
||||||
end
|
end
|
||||||
vim.fn.delete(tmpfile)
|
vim.fn.delete(tmpfile)
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user