Adds nvim config as home manager module
This commit is contained in:
parent
5a9ad9bbd1
commit
98f4a6679e
34 changed files with 1260 additions and 0 deletions
8
home/modules/nvim/config/lua/dnsc/keymaps.lua
Normal file
8
home/modules/nvim/config/lua/dnsc/keymaps.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
local opts = { noremap = true, silent = true, expr = true }
|
||||
|
||||
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", opts)
|
||||
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", opts)
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
79
home/modules/nvim/config/lua/dnsc/lazy.lua
Normal file
79
home/modules/nvim/config/lua/dnsc/lazy.lua
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local opts = { noremap = true, silent = true, expr = true }
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
vim.keymap.set("", "<Space>", "<Nop>", opts)
|
||||
|
||||
local options = {
|
||||
backup = false, -- creates a backup file
|
||||
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
|
||||
cmdheight = 1, -- more space in the neovim command line for displaying messages
|
||||
completeopt = { "menu", "menuone", "noselect" }, -- mostly just for cmp
|
||||
conceallevel = 0, -- so that `` is visible in markdown files
|
||||
fileencoding = "utf-8", -- the encoding written to a file
|
||||
hlsearch = true, -- highlight all matches on previous search pattern
|
||||
ignorecase = true, -- ignore case in search patterns
|
||||
mouse = "a", -- allow the mouse to be used in neovim
|
||||
pumheight = 10, -- pop up menu height
|
||||
showmode = false, -- we don't need to see things like -- INSERT -- anymore
|
||||
smartindent = true,
|
||||
breakindent = true,
|
||||
showtabline = 0, -- always show tabs
|
||||
smartcase = true, -- smart case
|
||||
splitbelow = true, -- force all horizontal splits to go below current window
|
||||
splitright = true, -- force all vertical splits to go to the right of current window
|
||||
swapfile = false, -- creates a swapfile
|
||||
termguicolors = true, -- set term gui colors (most terminals support this)
|
||||
timeoutlen = 200, -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||
undofile = true, -- enable persistent undo
|
||||
updatetime = 230, -- faster completion (4000ms default)
|
||||
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
||||
expandtab = true, -- convert tabs to spaces
|
||||
shiftwidth = 2, -- the number of spaces inserted for each indentation
|
||||
tabstop = 2, -- insert 2 spaces for a tab
|
||||
cursorline = true, -- highlight the current line
|
||||
number = true, -- set numbered lines
|
||||
relativenumber = true, -- set relative numbered lines
|
||||
numberwidth = 4, -- set number column width to 2 {default 4}
|
||||
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
|
||||
linebreak = true,
|
||||
breakat = " ^I!@*-+;:,./?",
|
||||
scrolloff = 6, -- is one of my fav
|
||||
sidescrolloff = 4,
|
||||
winbar = nil,
|
||||
}
|
||||
|
||||
vim.opt.shortmess:append("c")
|
||||
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "rose-pine" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
5
home/modules/nvim/config/lua/dnsc/leader.lua
Normal file
5
home/modules/nvim/config/lua/dnsc/leader.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
local opts = { noremap = true, silent = true, expr = true }
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
vim.keymap.set("", "<Space>", "<Nop>", opts)
|
||||
44
home/modules/nvim/config/lua/dnsc/options.lua
Normal file
44
home/modules/nvim/config/lua/dnsc/options.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
local options = {
|
||||
backup = false, -- creates a backup file
|
||||
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
|
||||
cmdheight = 1, -- more space in the neovim command line for displaying messages
|
||||
completeopt = { "menu", "menuone", "noselect" }, -- mostly just for cmp
|
||||
conceallevel = 0, -- so that `` is visible in markdown files
|
||||
fileencoding = "utf-8", -- the encoding written to a file
|
||||
hlsearch = true, -- highlight all matches on previous search pattern
|
||||
ignorecase = true, -- ignore case in search patterns
|
||||
mouse = "a", -- allow the mouse to be used in neovim
|
||||
pumheight = 10, -- pop up menu height
|
||||
showmode = false, -- we don't need to see things like -- INSERT -- anymore
|
||||
smartindent = true,
|
||||
breakindent = true,
|
||||
showtabline = 0, -- always show tabs
|
||||
smartcase = true, -- smart case
|
||||
splitbelow = true, -- force all horizontal splits to go below current window
|
||||
splitright = true, -- force all vertical splits to go to the right of current window
|
||||
swapfile = false, -- creates a swapfile
|
||||
termguicolors = true, -- set term gui colors (most terminals support this)
|
||||
timeoutlen = 200, -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||
undofile = true, -- enable persistent undo
|
||||
updatetime = 230, -- faster completion (4000ms default)
|
||||
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
||||
expandtab = true, -- convert tabs to spaces
|
||||
shiftwidth = 2, -- the number of spaces inserted for each indentation
|
||||
tabstop = 2, -- insert 2 spaces for a tab
|
||||
cursorline = true, -- highlight the current line
|
||||
number = true, -- set numbered lines
|
||||
relativenumber = true, -- set relative numbered lines
|
||||
numberwidth = 4, -- set number column width to 2 {default 4}
|
||||
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
|
||||
linebreak = true,
|
||||
breakat = " ^I!@*-+;:,./?",
|
||||
scrolloff = 6, -- is one of my fav
|
||||
sidescrolloff = 4,
|
||||
winbar = nil,
|
||||
}
|
||||
|
||||
vim.opt.shortmess:append("c")
|
||||
|
||||
for k, v in pairs(options) do
|
||||
vim.opt[k] = v
|
||||
end
|
||||
39
home/modules/nvim/config/lua/dnsc/utils.lua
Normal file
39
home/modules/nvim/config/lua/dnsc/utils.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
-- Highlight on yank
|
||||
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = "*",
|
||||
})
|
||||
|
||||
local function filter(arr, fn)
|
||||
if type(arr) ~= "table" then
|
||||
return arr
|
||||
end
|
||||
|
||||
local filtered = {}
|
||||
for k, v in pairs(arr) do
|
||||
if fn(v, k, arr) then
|
||||
table.insert(filtered, v)
|
||||
end
|
||||
end
|
||||
|
||||
return filtered
|
||||
end
|
||||
|
||||
local function filterReactDTS(value)
|
||||
-- Depending on typescript version either uri or targetUri is returned
|
||||
if value.uri then
|
||||
return string.match(value.uri, "%.d.ts") == nil
|
||||
elseif value.targetUri then
|
||||
return string.match(value.targetUri, "%.d.ts") == nil
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
filter = filter,
|
||||
filterReactDTS = filterReactDTS,
|
||||
}
|
||||
18
home/modules/nvim/config/lua/plugins/barbar.lua
Normal file
18
home/modules/nvim/config/lua/plugins/barbar.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
"romgrk/barbar.nvim",
|
||||
dependencies = {
|
||||
"lewis6991/gitsigns.nvim", -- OPTIONAL: for git status
|
||||
"nvim-tree/nvim-web-devicons", -- OPTIONAL: for file icons
|
||||
},
|
||||
init = function()
|
||||
vim.g.barbar_auto_setup = false
|
||||
end,
|
||||
opts = {
|
||||
animation = false,
|
||||
auto_hide = false,
|
||||
maximum_length = 35,
|
||||
icons = { filetype = { enabled = false }, button = "", modified = { button = "m" } },
|
||||
highlight_visible = false,
|
||||
},
|
||||
version = "^1.0.0", -- optional: only update when a new 1.x version is released
|
||||
}
|
||||
4
home/modules/nvim/config/lua/plugins/diffview.lua
Normal file
4
home/modules/nvim/config/lua/plugins/diffview.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
"sindrets/diffview.nvim",
|
||||
opts = {},
|
||||
}
|
||||
5
home/modules/nvim/config/lua/plugins/gitlinker.lua
Normal file
5
home/modules/nvim/config/lua/plugins/gitlinker.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"linrongbin16/gitlinker.nvim",
|
||||
cmd = "GitLink",
|
||||
opts = {},
|
||||
}
|
||||
42
home/modules/nvim/config/lua/plugins/gitsigns.lua
Normal file
42
home/modules/nvim/config/lua/plugins/gitsigns.lua
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = "│" },
|
||||
change = { text = "│" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
untracked = { text = "┆" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true,
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
},
|
||||
},
|
||||
}
|
||||
22
home/modules/nvim/config/lua/plugins/go.lua
Normal file
22
home/modules/nvim/config/lua/plugins/go.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
"ray-x/go.nvim",
|
||||
dependencies = { -- optional packages
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
event = { "CmdlineEnter" },
|
||||
ft = { "go", "gomod" },
|
||||
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
|
||||
opts = {},
|
||||
init = function()
|
||||
local format_sync_grp = vim.api.nvim_create_augroup("goimports", {})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*.go",
|
||||
callback = function()
|
||||
require("go.format").goimports()
|
||||
end,
|
||||
group = format_sync_grp,
|
||||
})
|
||||
end,
|
||||
}
|
||||
39
home/modules/nvim/config/lua/plugins/harpoon.lua
Normal file
39
home/modules/nvim/config/lua/plugins/harpoon.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local harpoon = require("harpoon")
|
||||
|
||||
harpoon:setup()
|
||||
|
||||
vim.keymap.set("n", "<leader>ha", function()
|
||||
harpoon:list():add()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>hx", function()
|
||||
harpoon:list():select(1)
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>hc", function()
|
||||
harpoon:list():select(2)
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>hv", function()
|
||||
harpoon:list():select(3)
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>hs", function()
|
||||
harpoon:list():select(4)
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>hp", function()
|
||||
harpoon:list():prev()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>hn", function()
|
||||
harpoon:list():next()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>hh", function()
|
||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||
end)
|
||||
end,
|
||||
}
|
||||
4
home/modules/nvim/config/lua/plugins/helpers.lua
Normal file
4
home/modules/nvim/config/lua/plugins/helpers.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
"romainl/vim-cool",
|
||||
"tpope/vim-sleuth",
|
||||
}
|
||||
16
home/modules/nvim/config/lua/plugins/ibl.lua
Normal file
16
home/modules/nvim/config/lua/plugins/ibl.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
---@module "ibl"
|
||||
---@type ibl.config
|
||||
opts = {
|
||||
indent = {
|
||||
smart_indent_cap = false,
|
||||
char = "╎",
|
||||
},
|
||||
scope = {
|
||||
show_start = false,
|
||||
show_end = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
19
home/modules/nvim/config/lua/plugins/lazygit.lua
Normal file
19
home/modules/nvim/config/lua/plugins/lazygit.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"kdheepak/lazygit.nvim",
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
-- optional for floating window border decoration
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||
-- order to load the plugin when the command is run for the first time
|
||||
keys = {
|
||||
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" },
|
||||
},
|
||||
}
|
||||
268
home/modules/nvim/config/lua/plugins/lsp.lua
Normal file
268
home/modules/nvim/config/lua/plugins/lsp.lua
Normal file
|
|
@ -0,0 +1,268 @@
|
|||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
version = "0.1.9",
|
||||
dependencies = {
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"b0o/schemastore.nvim",
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local luasnip = require("luasnip")
|
||||
local dnscUtils = require("dnsc.utils")
|
||||
local lspUtils = require("lspconfig.util")
|
||||
local cmp = require("cmp")
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
local servers = {
|
||||
"angularls",
|
||||
"ts_ls",
|
||||
"lua_ls",
|
||||
"jsonls",
|
||||
"html",
|
||||
"cssls",
|
||||
"tailwindcss",
|
||||
"gopls",
|
||||
"astro",
|
||||
"tinymist",
|
||||
}
|
||||
|
||||
require("mason").setup()
|
||||
-- Automatic Server Installation with Mason
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = servers,
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
-- LANGUAGE SERVERS
|
||||
-- Lua
|
||||
lspconfig.lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Typescript
|
||||
lspconfig.tsserver.setup({
|
||||
capabilities = capabilities,
|
||||
root_dir = lspUtils.root_pattern("package.json"),
|
||||
init_options = {
|
||||
preferences = {
|
||||
importModuleSpecifierPreference = "relative",
|
||||
importModuleSpecifierEnding = "minimal",
|
||||
},
|
||||
},
|
||||
handlers = {
|
||||
["textDocument/definition"] = function(err, result, method, ...)
|
||||
if vim.tbl_islist(result) and #result > 1 then
|
||||
local filtered_result = dnscUtils.filter(result, dnscUtils.filterReactDTS)
|
||||
return vim.lsp.handlers["textDocument/definition"](err, filtered_result, method, ...)
|
||||
end
|
||||
|
||||
vim.lsp.handlers["textDocument/definition"](err, result, method, ...)
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- JSON
|
||||
lspconfig.jsonls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- HTML
|
||||
lspconfig.html.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- Astro
|
||||
lspconfig.astro.setup({})
|
||||
|
||||
-- Tailwind
|
||||
lspconfig.tailwindcss.setup({})
|
||||
|
||||
-- Typst
|
||||
lspconfig.tinymist.setup({
|
||||
single_file_support = true,
|
||||
root_dir = function()
|
||||
return vim.fn.getcwd()
|
||||
end,
|
||||
settings = {},
|
||||
})
|
||||
|
||||
-- CSS
|
||||
lspconfig.cssls.setup({})
|
||||
|
||||
-- Angular
|
||||
lspconfig.angularls.setup({})
|
||||
|
||||
-- Go
|
||||
lspconfig.gopls.setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- Run gofmt + goimports on save
|
||||
local format_sync_grp = vim.api.nvim_create_augroup("goimports", {})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*.go",
|
||||
callback = function()
|
||||
require("go.format").goimports()
|
||||
end,
|
||||
group = format_sync_grp,
|
||||
})
|
||||
|
||||
-- LSP Keybindings
|
||||
-- Global mappings.
|
||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float)
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
|
||||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist)
|
||||
|
||||
-- Use LspAttach autocommand to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
|
||||
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set({ "n", "v" }, "<space>ca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
|
||||
vim.keymap.set("n", "<space>f", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
-- Kind icons
|
||||
vim_item.kind = string.format("%s ", vim_item.kind) -- This concatenates the icons with the name of the item kind
|
||||
-- Source
|
||||
vim_item.menu = ({
|
||||
buffer = "[Buffer]",
|
||||
nvim_lsp = "[LSP]",
|
||||
luasnip = "[Snip]",
|
||||
nvim_lua = "[Lua]",
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
if luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
else
|
||||
cmp.confirm({
|
||||
select = true,
|
||||
})
|
||||
end
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end),
|
||||
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.locally_jumpable(1) then
|
||||
luasnip.jump(1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp", keyword_length = 1 },
|
||||
{ name = "path" },
|
||||
{ name = "buffer", keyword_length = 3 },
|
||||
{ name = "luasnip" }, -- For luasnip users.
|
||||
}),
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ "/", "?" }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = "cmdline" },
|
||||
}),
|
||||
})
|
||||
|
||||
-- Set up vim-dadbod completions
|
||||
cmp.setup.filetype({ "sql", "mysql", "psql" }, {
|
||||
sources = {
|
||||
{ name = "vim-dadbod-completion" },
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Set up org mode
|
||||
cmp.setup.filetype({ "org" }, {
|
||||
sources = {
|
||||
{ name = "orgmode" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
19
home/modules/nvim/config/lua/plugins/lualine.lua
Normal file
19
home/modules/nvim/config/lua/plugins/lualine.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = {
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
-- globalstatus = true
|
||||
component_separators = { left = "|", right = "|" },
|
||||
section_separators = { left = "", right = "" },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = {},
|
||||
lualine_c = { "branch", "diff", "diagnostics" },
|
||||
lualine_x = { "filetype", "encoding" },
|
||||
lualine_y = {},
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
},
|
||||
}
|
||||
4
home/modules/nvim/config/lua/plugins/mini.pairs.lua
Normal file
4
home/modules/nvim/config/lua/plugins/mini.pairs.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
"echasnovski/mini.pairs",
|
||||
opts = {},
|
||||
}
|
||||
93
home/modules/nvim/config/lua/plugins/null-ls.lua
Normal file
93
home/modules/nvim/config/lua/plugins/null-ls.lua
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
return {
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"nvimtools/none-ls.nvim",
|
||||
"nvimtools/none-ls-extras.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
config = function()
|
||||
local lsp = require("lspconfig")
|
||||
local null_ls = require("null-ls")
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
|
||||
local string_starts_with = function(str, start)
|
||||
return string.sub(str, 1, #start) == start
|
||||
end
|
||||
|
||||
local create_runtime_condition = function(config_names)
|
||||
local bufnr_cache = {}
|
||||
local config_path_cache = {}
|
||||
|
||||
return function(params)
|
||||
if bufnr_cache[params.bufnr] ~= nil then
|
||||
return bufnr_cache[params.bufnr]
|
||||
else
|
||||
for _, cached_config_path in ipairs(config_path_cache) do
|
||||
if string_starts_with(params.bufname, cached_config_path) then
|
||||
bufnr_cache[params.bufnr] = true
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local config_path = lsp.util.root_pattern(config_names)(params.bufname)
|
||||
|
||||
local has_config = config_path ~= nil
|
||||
if has_config then
|
||||
table.insert(config_path_cache, config_path)
|
||||
end
|
||||
bufnr_cache[params.bufnr] = has_config
|
||||
|
||||
return has_config
|
||||
end
|
||||
end
|
||||
|
||||
local eslint_runtime_condition = create_runtime_condition({
|
||||
".eslintrc.cjs",
|
||||
".eslintrc.js",
|
||||
".eslintrc.json",
|
||||
".eslintrc.yaml",
|
||||
".eslintrc.yml",
|
||||
})
|
||||
|
||||
require("null-ls").setup({
|
||||
root_dir = require("null-ls.utils").root_pattern(".null-ls-root", "package.json", ".git"),
|
||||
sources = {
|
||||
-- null_ls.builtins.diagnostics.markdownlint,
|
||||
null_ls.builtins.formatting.prettierd,
|
||||
require("none-ls.code_actions.eslint_d"),
|
||||
require("none-ls.diagnostics.eslint_d").with({
|
||||
runtime_condition = eslint_runtime_condition,
|
||||
}),
|
||||
require("none-ls.formatting.eslint_d").with({
|
||||
runtime_condition = eslint_runtime_condition,
|
||||
}),
|
||||
null_ls.builtins.formatting.stylua,
|
||||
},
|
||||
on_attach = function(current_client, bufnr)
|
||||
if current_client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({
|
||||
bufnr = bufnr,
|
||||
filter = function(client)
|
||||
return client.name == "null-ls"
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
require("mason-null-ls").setup({
|
||||
ensure_installed = nil,
|
||||
automatic_installation = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
6
home/modules/nvim/config/lua/plugins/nvim-surround.lua
Normal file
6
home/modules/nvim/config/lua/plugins/nvim-surround.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
"kylechui/nvim-surround",
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
}
|
||||
28
home/modules/nvim/config/lua/plugins/obsidian.lua
Normal file
28
home/modules/nvim/config/lua/plugins/obsidian.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
return {
|
||||
"epwalsh/obsidian.nvim",
|
||||
version = "*", -- recommended, use latest release instead of latest commit
|
||||
lazy = true,
|
||||
ft = "markdown",
|
||||
event = {
|
||||
"BufReadPre /home/dennis/notes/**.md",
|
||||
"BufNewFile /home/dennis/notes/**.md",
|
||||
},
|
||||
opts = {
|
||||
workspaces = {
|
||||
{
|
||||
name = "notes",
|
||||
path = "~/notes",
|
||||
},
|
||||
},
|
||||
daily_notes = {
|
||||
-- Optional, if you keep daily notes in a separate directory.
|
||||
folder = "~/notes/001_dailies",
|
||||
-- Optional, if you want to change the date format for the ID of daily notes.
|
||||
date_format = "%Y-%m-%d",
|
||||
-- Optional, if you want to change the date format of the default alias of daily notes.
|
||||
alias_format = "%B %-d, %Y",
|
||||
-- Optional, if you want to automatically insert a template from your template directory like 'daily.md'
|
||||
template = nil,
|
||||
},
|
||||
},
|
||||
}
|
||||
8
home/modules/nvim/config/lua/plugins/oil.lua
Normal file
8
home/modules/nvim/config/lua/plugins/oil.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"stevearc/oil.nvim",
|
||||
opts = {
|
||||
keymaps = {
|
||||
["q"] = "actions.close",
|
||||
},
|
||||
},
|
||||
}
|
||||
16
home/modules/nvim/config/lua/plugins/substitute.lua
Normal file
16
home/modules/nvim/config/lua/plugins/substitute.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
"gbprod/substitute.nvim",
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
config = function()
|
||||
require("substitute").setup({})
|
||||
|
||||
vim.keymap.set("n", "s", require("substitute").operator, { noremap = true })
|
||||
vim.keymap.set("n", "ss", require("substitute").line, { noremap = true })
|
||||
vim.keymap.set("n", "S", require("substitute").eol, { noremap = true })
|
||||
vim.keymap.set("x", "s", require("substitute").visual, { noremap = true })
|
||||
end,
|
||||
}
|
||||
20
home/modules/nvim/config/lua/plugins/telescope.lua
Normal file
20
home/modules/nvim/config/lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.8",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
pickers = {},
|
||||
extensions = {
|
||||
fzf = {},
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
require("telescope").load_extension("fzf")
|
||||
end,
|
||||
}
|
||||
58
home/modules/nvim/config/lua/plugins/theme.lua
Normal file
58
home/modules/nvim/config/lua/plugins/theme.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
return {
|
||||
{
|
||||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
config = function()
|
||||
require("rose-pine").setup({
|
||||
variant = "auto", -- auto, main, moon, or dawn
|
||||
dark_variant = "main", -- main, moon, or dawn
|
||||
dim_inactive_windows = false,
|
||||
extend_background_behind_borders = true,
|
||||
|
||||
enable = {
|
||||
terminal = true,
|
||||
migrations = true,
|
||||
},
|
||||
|
||||
styles = {
|
||||
bold = true,
|
||||
italic = false,
|
||||
transparency = true,
|
||||
},
|
||||
|
||||
groups = {
|
||||
border = "muted",
|
||||
link = "iris",
|
||||
panel = "surface",
|
||||
|
||||
error = "love",
|
||||
hint = "iris",
|
||||
info = "foam",
|
||||
note = "pine",
|
||||
todo = "rose",
|
||||
warn = "gold",
|
||||
|
||||
git_add = "foam",
|
||||
git_change = "rose",
|
||||
git_delete = "love",
|
||||
git_dirty = "rose",
|
||||
git_ignore = "muted",
|
||||
git_merge = "iris",
|
||||
git_rename = "pine",
|
||||
git_stage = "iris",
|
||||
git_text = "rose",
|
||||
git_untracked = "subtle",
|
||||
|
||||
h1 = "iris",
|
||||
h2 = "foam",
|
||||
h3 = "rose",
|
||||
h4 = "gold",
|
||||
h5 = "pine",
|
||||
h6 = "foam",
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
end,
|
||||
},
|
||||
}
|
||||
7
home/modules/nvim/config/lua/plugins/todo-comments.lua
Normal file
7
home/modules/nvim/config/lua/plugins/todo-comments.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
signs = false,
|
||||
},
|
||||
}
|
||||
97
home/modules/nvim/config/lua/plugins/treesitter.lua
Normal file
97
home/modules/nvim/config/lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = {
|
||||
"angular",
|
||||
"bash",
|
||||
"c",
|
||||
"css",
|
||||
"diff",
|
||||
"html",
|
||||
"javascript",
|
||||
"jsdoc",
|
||||
"json",
|
||||
"jsonc",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"luap",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"printf",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"xml",
|
||||
"yaml",
|
||||
},
|
||||
auto_install = true,
|
||||
sync_install = false,
|
||||
ignore_install = {},
|
||||
modules = {},
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<c-space>",
|
||||
node_incremental = "<c-space>",
|
||||
scope_incremental = "<c-s>",
|
||||
node_decremental = "<M-space>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>a"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>A"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
20
home/modules/nvim/config/lua/plugins/vim-dadbod-ui.lua
Normal file
20
home/modules/nvim/config/lua/plugins/vim-dadbod-ui.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
return {
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
"pbogut/vim-dadbod-ssh",
|
||||
{ "tpope/vim-dadbod", lazy = true },
|
||||
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
|
||||
},
|
||||
cmd = {
|
||||
"DBUI",
|
||||
"DBUIToggle",
|
||||
"DBUIAddConnection",
|
||||
"DBUIFindBuffer",
|
||||
},
|
||||
init = function()
|
||||
vim.g.db_ui_use_nerd_fonts = 1
|
||||
vim.g.dbs = {
|
||||
{ name = "freed_dev", url = "sqlite:./freed.db" },
|
||||
}
|
||||
end,
|
||||
}
|
||||
185
home/modules/nvim/config/lua/plugins/which-key.lua
Normal file
185
home/modules/nvim/config/lua/plugins/which-key.lua
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
icons = { mappings = false },
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>.", "<cmd>Telescope find_files<cr>", desc = "Find file in dir", mode = "n" },
|
||||
{ "<leader><leader>", "<cmd>Telescope git_files<cr>", desc = "Find git file", mode = "n" },
|
||||
{ "<leader>B", "<cmd>Telescope buffers<cr>", desc = "Opens buffers", mode = "n" },
|
||||
{ "<leader>b", group = "buffer", mode = "n" },
|
||||
{ "<leader>b,", "<Cmd>BufferMovePrevious<CR>", desc = "Move buffer back", mode = "n" },
|
||||
{
|
||||
"<leader>b.",
|
||||
"<Cmd>BufferMoveNext<CR>",
|
||||
desc = "Move buffer forward",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>bD",
|
||||
"<cmd>BufferCloseAllButCurrent<cr>",
|
||||
desc = "Delete all buffers but current",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>bd",
|
||||
"<Cmd>BufferClose<CR>",
|
||||
desc = "Delete current buffer",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>bh",
|
||||
"<Cmd>BufferPrevious<CR>",
|
||||
desc = "Go to previous buffer",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>bl",
|
||||
"<Cmd>BufferNext<CR>",
|
||||
desc = "Go to next buffer",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>bp", "<cmd>BufferPick<cr>", desc = "Pick a buffer", mode = "n" },
|
||||
{
|
||||
"<leader>bx",
|
||||
"<cmd>BufferCloseAllButPinned<cr>",
|
||||
desc = "Delete all buffers",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>c", group = "code", mode = "n" },
|
||||
{ "<leader>ca", ":lua vim.lsp.buf.code_action()<cr>", desc = "Code actions", mode = "n" },
|
||||
{ "<leader>cd", ":lua require'telescope.builtin'.diagnostics{}<cr>", desc = "Show diagnostics", mode = "n" },
|
||||
{
|
||||
"<leader>cf",
|
||||
":lua require'telescope.builtin'.builtin.lsp_references{}<cr>",
|
||||
desc = "Show references",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>q",
|
||||
"<cmd>wq<cr>",
|
||||
desc = "Close window and buffer",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>f", group = "file", mode = "n" },
|
||||
{
|
||||
"<leader>fn",
|
||||
"<cmd>enew<cr>",
|
||||
desc = "Create a new file",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Open Recent File", mode = "n" },
|
||||
{
|
||||
"<leader>fs",
|
||||
"<cmd>w<cr>",
|
||||
desc = "Save currently opened file",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>g", group = "git", mode = "n" },
|
||||
{
|
||||
"<leader>gb",
|
||||
"<cmd>Gitsigns toggle_current_line_blame<cr>",
|
||||
desc = "Toggle git line blame",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>gg", "<cmd>LazyGit<CR>", desc = "Opens lazygit", mode = "n" },
|
||||
{
|
||||
"<leader>glo",
|
||||
"<cmd>GitLink!<cr>",
|
||||
desc = "Open permalink in browser",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>gly", "<cmd>GitLink<cr>", desc = "Copy permalink", mode = "n" },
|
||||
{
|
||||
"<leader>n",
|
||||
"<cmd>Oil --float<cr>",
|
||||
desc = "Open file browser",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>q", "<cmd>qa!<cr>", desc = "Leave neovim", mode = "n" },
|
||||
{ "<leader>s", group = "search", mode = "n" },
|
||||
{ "<leader>sb", ":lua require'telescope.builtin'.buffers{}<cr>", desc = "Find buffer", mode = "n" },
|
||||
{ "<leader>ss", "<cmd>Telescope live_grep<CR>", desc = "Live Grep", mode = "n" },
|
||||
{
|
||||
"<leader>sw",
|
||||
"<cmd>Telescope grep_string<cr>",
|
||||
desc = "Search current word",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>t", group = "diagnostics (lsp)", mode = "n" },
|
||||
{
|
||||
"<leader>td",
|
||||
"<cmd>Telescope diagnostics<cr>",
|
||||
desc = "Show LSP diagnostics",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>ta", "<cmd>TodoQuickFix<cr>", desc = "Show all todo comments", mode = "n" },
|
||||
{ "<leader>tt", "<cmd>TodoTelescope<cr>", desc = "Show all todo comments (Telescope)", mode = "n" },
|
||||
{ "<leader>w", group = "window", mode = "n" },
|
||||
{
|
||||
"<leader>w+",
|
||||
":vertical resize +4<CR>",
|
||||
desc = "Increase window size",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>w-",
|
||||
":vertical resize -4<CR>",
|
||||
desc = "Decrease window size",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>wd",
|
||||
"<C-W>q",
|
||||
desc = "Close active window",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>wh",
|
||||
"<C-W>h",
|
||||
desc = "Move to window on left",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>wj",
|
||||
"<C-W>j",
|
||||
desc = "Move to window on bottom",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>wk",
|
||||
"<C-W>k",
|
||||
desc = "Move to window on top",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>wl",
|
||||
"<C-W>l",
|
||||
desc = "Move to window on right",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>ws",
|
||||
"<cmd>sp<cr>",
|
||||
desc = "Split windows horizontally",
|
||||
mode = "n",
|
||||
},
|
||||
{
|
||||
"<leader>wv",
|
||||
"<cmd>vsp<cr>",
|
||||
desc = "Split windows vertically",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>x", group = "config", mode = "n" },
|
||||
{
|
||||
"<leader>xn",
|
||||
"<cmd>set number relativenumber<cr>",
|
||||
desc = "Show relative numbers",
|
||||
mode = "n",
|
||||
},
|
||||
{ "<leader>xr", "<cmd>source $MYVIMRC<cr>", desc = "Reload config", mode = "n" },
|
||||
{ "<leader>do", "<cmd>DiffviewOpen<cr>", desc = "Open diff view", mode = "n" },
|
||||
{ "<leader>dh", "<cmd>DiffviewFileHistory<cr>", desc = "Open file history diff", mode = "n" },
|
||||
},
|
||||
}
|
||||
4
home/modules/nvim/config/lua/plugins/zen-mode.lua
Normal file
4
home/modules/nvim/config/lua/plugins/zen-mode.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
"folke/zen-mode.nvim",
|
||||
opts = {},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue