mirror of
https://github.com/iofq/nvim.nix.git
synced 2026-01-23 08:55:16 -06:00
use kickstart-nix
This commit is contained in:
parent
53bfda8bcd
commit
b33413dd18
36 changed files with 1291 additions and 519 deletions
13
nvim/plugin/aerial.lua
Normal file
13
nvim/plugin/aerial.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
if vim.g.did_load_aerial_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_aerial_plugin = true
|
||||
|
||||
require("aerial").setup({
|
||||
default_direction = "left",
|
||||
autojump = true,
|
||||
on_attach = function(bufnr)
|
||||
vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
|
||||
vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
|
||||
end,
|
||||
})
|
||||
19
nvim/plugin/colors.lua
Normal file
19
nvim/plugin/colors.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
if vim.g.did_load_colors_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_colors_plugin = true
|
||||
|
||||
require("rose-pine").setup({
|
||||
variant = "moon",
|
||||
styles = {
|
||||
bold = false,
|
||||
italic = false,
|
||||
transparency = true,
|
||||
},
|
||||
})
|
||||
require('nightfox').setup({
|
||||
options = {
|
||||
transparent = true, -- Disable setting background
|
||||
terminal_colors = false, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal`
|
||||
},
|
||||
})
|
||||
47
nvim/plugin/completion.lua
Normal file
47
nvim/plugin/completion.lua
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
if vim.g.did_load_completion_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_completion_plugin = true
|
||||
local cmp = require'cmp'
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
experimental = {
|
||||
native_menu = false,
|
||||
ghost_text = true,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-j>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-k>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['q'] = cmp.mapping.abort(),
|
||||
['<C-Space>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
}),
|
||||
matching = { disallow_symbol_nonprefix_matching = false }
|
||||
})
|
||||
7
nvim/plugin/diffview.lua
Normal file
7
nvim/plugin/diffview.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
if vim.g.did_load_diffview_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_diffview_plugin = true
|
||||
|
||||
require("diffview").setup({ use_icons = false, })
|
||||
vim.keymap.set('n', '<leader>gdd', vim.cmd.DiffviewOpen, { desc = '[g]it [d]iffview open' })
|
||||
7
nvim/plugin/git.lua
Normal file
7
nvim/plugin/git.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
if vim.g.did_load_diffview_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_diffview_plugin = true
|
||||
require("diffview").setup({
|
||||
use_icons = false,
|
||||
})
|
||||
30
nvim/plugin/gitsigns.lua
Normal file
30
nvim/plugin/gitsigns.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
if vim.g.did_load_gitsigns_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_gitsigns_plugin = true
|
||||
|
||||
vim.schedule(function()
|
||||
require('gitsigns').setup{
|
||||
signcolumn = false,
|
||||
numhl = true,
|
||||
on_attach = function()
|
||||
local gs = package.loaded.gitsigns
|
||||
vim.keymap.set("n", "<leader>gg", gs.preview_hunk, {desc = "git preview hunk"})
|
||||
vim.keymap.set('n', '<leader>gb', function() gs.blame_line{full=true} end, {desc = "git blame_line"})
|
||||
vim.keymap.set('n', '<leader>gr', gs.reset_hunk, {desc = "git reset hunk"})
|
||||
vim.keymap.set('v', '<leader>gr', function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end, {desc = "git reset hunk"})
|
||||
-- Navigation
|
||||
vim.keymap.set('n', ']g', function()
|
||||
if vim.wo.diff then return ']c' end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, {expr=true})
|
||||
|
||||
vim.keymap.set('n', '[g', function()
|
||||
if vim.wo.diff then return '[c' end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, {expr=true})
|
||||
end
|
||||
}
|
||||
end)
|
||||
13
nvim/plugin/keymaps.lua
Normal file
13
nvim/plugin/keymaps.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
vim.keymap.set("n","gr", "gT", {noremap = true, silent = true})
|
||||
vim.keymap.set("n","n", "nzz", {noremap = true, silent = true})
|
||||
vim.keymap.set("n", "N", "Nzz", {noremap = true, silent = true})
|
||||
vim.keymap.set('n', '<C-d>', '<C-d>zz')
|
||||
vim.keymap.set('n', '<C-u>', '<C-u>zz')
|
||||
vim.keymap.set('n', '<C-f>', '<C-f>zz')
|
||||
vim.keymap.set('n', '<C-b>', '<C-b>zz')
|
||||
vim.keymap.set("n","<CR>", "m0i<cr><Esc>`0", {noremap = true, silent = true})
|
||||
vim.keymap.set({'v', 'i'}, 'wq', '<esc>l', {noremap = true, silent = true})
|
||||
vim.keymap.set({'n', 'v', 'i'}, 'qwq', '<esc>l<cmd>wqa<CR>', {noremap = true, silent = true})
|
||||
vim.keymap.set({'n', 'v'}, '<leader>yy', '"+y', {noremap = true, silent = true, desc = "Yank to clip"})
|
||||
vim.keymap.set({'n', 'v'}, '<leader>yp', '"+p', {noremap = true, silent = true, desc = "Paste from clip"})
|
||||
vim.keymap.set({'n', 'v'}, '<leader>yd', '"+d', {noremap = true, silent = true, desc = "Delete to clip"})
|
||||
65
nvim/plugin/lsp.lua
Normal file
65
nvim/plugin/lsp.lua
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
if vim.g.did_load_lsp_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_lsp_plugin = true
|
||||
|
||||
-- Setup language servers.
|
||||
local lspconfig = require('lspconfig')
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
lspconfig.gopls.setup { on_attach = function(_, bufnr)
|
||||
capabilities = capabilities
|
||||
vim.api.nvim_command("au BufWritePre <buffer> lua vim.lsp.buf.format { async = false }")
|
||||
end
|
||||
}
|
||||
lspconfig.pyright.setup { capabilities = capabilities }
|
||||
lspconfig.nil_ls.setup { capabilities = capabilities }
|
||||
|
||||
vim.keymap.set('n', '<leader>de', vim.diagnostic.open_float, {desc = "Toggle diagnostic"})
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, {desc = "Prev diagnostic"})
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, {desc = "Next diagnostic"})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
})
|
||||
-- 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)
|
||||
local bufnr = ev.buf
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = ev.buf, noremap = true, silent = true , desc = "LSP hover"})
|
||||
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, { buffer = ev.buf, noremap = true, silent = true , desc = "LSP Rename"})
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>da', vim.lsp.buf.code_action, { buffer = ev.buf, noremap = true, silent = true , desc = "LSP code action"})
|
||||
vim.keymap.set("n", "<leader>dd", "<cmd>Telescope lsp_definitions<cr>", { buffer = ev.buf, noremap = true, silent = true , desc = "LSP definitions"})
|
||||
vim.keymap.set("n", "<leader>di", "<cmd>Telescope lsp_implementations<cr>", { buffer = ev.buf, noremap = true, silent = true , desc = "LSP implementations"})
|
||||
vim.keymap.set("n", "<leader>dr", "<cmd>Telescope lsp_references<cr>", { buffer = ev.buf, noremap = true, silent = true , desc = "LSP references"})
|
||||
vim.keymap.set("n", "<leader>dt", "<cmd>Telescope lsp_type_definitions<cr>", { buffer = ev.buf, noremap = true, silent = true , desc = "LSP type defs"})
|
||||
vim.keymap.set("n", "<leader>ds", "<cmd>Telescope lsp_document_symbols<cr>", { buffer = ev.buf, noremap = true, silent = true , desc = "LSP symbols"})
|
||||
vim.keymap.set('n', '<leader>dl', vim.lsp.codelens.run, { buffer = ev.buf, noremap = true, silent = true , desc = "LSP codelens"})
|
||||
vim.keymap.set('n', '<space>df', function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end,{ buffer = ev.buf, noremap = true, silent = true , desc = "LSP format"})
|
||||
-- Auto-refresh code lenses
|
||||
if not client then
|
||||
return
|
||||
end
|
||||
local group = vim.api.nvim_create_augroup(string.format('lsp-%s-%s', bufnr, client.id), {})
|
||||
if client.server_capabilities.codeLensProvider then
|
||||
vim.api.nvim_create_autocmd({ 'InsertLeave', 'BufWritePost', 'TextChanged' }, {
|
||||
group = group,
|
||||
callback = function()
|
||||
vim.lsp.codelens.refresh { bufnr = bufnr }
|
||||
end,
|
||||
buffer = bufnr,
|
||||
})
|
||||
vim.lsp.codelens.refresh { bufnr = bufnr }
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
11
nvim/plugin/lualine.lua
Normal file
11
nvim/plugin/lualine.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
if vim.g.did_load_lualine_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_lualine_plugin = true
|
||||
|
||||
vim.schedule(function()
|
||||
require('lualine').setup {
|
||||
globalstatus = true,
|
||||
extensions = { 'fugitive', 'fzf', 'toggleterm', 'quickfix' },
|
||||
}
|
||||
end)
|
||||
37
nvim/plugin/luasnip.lua
Normal file
37
nvim/plugin/luasnip.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
if vim.g.did_load_luasnip_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_luasnip_plugin = true
|
||||
|
||||
local ls = require("luasnip")
|
||||
ls.config.set_config {
|
||||
history = true,
|
||||
updateevents = "TextChanged, TextChangedI",
|
||||
}
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
vim.keymap.set({"i", "s"}, "<C-K>", function()
|
||||
if ls.expand_or_jumpable() then
|
||||
ls.expand_or_jump()
|
||||
end
|
||||
end, {silent = true})
|
||||
|
||||
vim.keymap.set({"i", "s"}, "<C-J>", function()
|
||||
if ls.jumpable(-1) then
|
||||
ls.jump(-1)
|
||||
end
|
||||
end, {silent = true})
|
||||
|
||||
vim.keymap.set({"i", "s"}, "<C-L>", function()
|
||||
if ls.choice_active() then
|
||||
ls.change_choice(1)
|
||||
end
|
||||
end, {silent = true})
|
||||
|
||||
--------------------
|
||||
-- Snippets --
|
||||
--------------------
|
||||
local fmta = require("luasnip.extras.fmt").fmta
|
||||
ls.add_snippets("go", {
|
||||
ls.snippet("ie", fmta("if err != nil {\n\treturn <err>\n}", { err = ls.insert_node(1, "err") })),
|
||||
})
|
||||
69
nvim/plugin/mini.lua
Normal file
69
nvim/plugin/mini.lua
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
if vim.g.did_load_mini_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_mini_plugin = true
|
||||
|
||||
-- din( dina
|
||||
require('mini.ai').setup()
|
||||
-- gc gcc
|
||||
require('mini.comment').setup()
|
||||
|
||||
-- Add surrounding with sa
|
||||
-- Delete surrounding with sd.
|
||||
-- Replace surrounding with sr.
|
||||
-- Find surrounding with sf or sF (move cursor right or left).
|
||||
-- Highlight surrounding with sh<char>.
|
||||
-- 'f' - function call (string of alphanumeric symbols or '_' or '.' followed by balanced '()'). In "input" finds function call, in "output" prompts user to enter function name.
|
||||
-- 't' - tag. In "input" finds tag with same identifier, in "output" prompts user to enter tag name.
|
||||
-- All symbols in brackets '()', '[]', '{}', '<>".
|
||||
-- '?' - interactive. Prompts user to enter left and right parts.
|
||||
require('mini.surround').setup()
|
||||
|
||||
-- :Trim
|
||||
require('mini.trailspace').setup()
|
||||
vim.api.nvim_create_user_command('Trim',
|
||||
function()
|
||||
require("mini.trailspace").trim()
|
||||
end, {}
|
||||
)
|
||||
|
||||
-- prefix \
|
||||
-- `b` - |'background'|.
|
||||
-- `c` - |'cursorline'|.
|
||||
-- `C` - |'cursorcolumn'|.
|
||||
-- `d` - diagnostic (via |vim.diagnostic.enable()| and |vim.diagnostic.disable()|).
|
||||
-- `h` - |'hlsearch'| (or |v:hlsearch| to be precise).
|
||||
-- `i` - |'ignorecase'|.
|
||||
-- `l` - |'list'|.
|
||||
-- `n` - |'number'|.
|
||||
-- `r` - |'relativenumber'|.
|
||||
-- `s` - |'spell'|.
|
||||
-- `w` - |'wrap'|.
|
||||
require('mini.basics').setup({
|
||||
mappings = {
|
||||
windows = true
|
||||
}
|
||||
})
|
||||
|
||||
-- gS
|
||||
require('mini.splitjoin').setup({
|
||||
detect = {
|
||||
separator = '[,;\n]'
|
||||
}
|
||||
})
|
||||
|
||||
require('mini.pairs').setup()
|
||||
vim.cmd([[ hi MiniCursorwordCurrent ctermfg=240 ]])
|
||||
|
||||
-- f F t T
|
||||
require('mini.jump').setup()
|
||||
require('mini.jump2d').setup({
|
||||
mappings = { start_jumping = '<leader>s' }
|
||||
})
|
||||
|
||||
indent = require('mini.indentscope')
|
||||
indent.setup({
|
||||
options = { try_as_border = false },
|
||||
draw = { delay = 0 }
|
||||
})
|
||||
indent.gen_animation.none()
|
||||
20
nvim/plugin/misc.lua
Normal file
20
nvim/plugin/misc.lua
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
if vim.g.did_load_plugins_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_plugins_plugin = true
|
||||
|
||||
-- many plugins annoyingly require a call to a 'setup' function to be loaded,
|
||||
-- even with default configs
|
||||
|
||||
require("neogen").setup{}
|
||||
vim.keymap.set("n","<leader>nd", "<cmd>Neogen<CR>", {noremap = true, silent = true, desc = "Neogen - gen comments"})
|
||||
|
||||
require("toggleterm").setup{
|
||||
open_mapping = [[<C-\>]],
|
||||
direction = "float",
|
||||
close_on_exit = true,
|
||||
}
|
||||
|
||||
require('which-key').setup {
|
||||
preset = 'helix'
|
||||
}
|
||||
15
nvim/plugin/neogit.lua
Normal file
15
nvim/plugin/neogit.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
if vim.g.did_load_neogit_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_neogit_plugin = true
|
||||
|
||||
local neogit = require('neogit')
|
||||
neogit.setup {
|
||||
disable_builtin_notifications = true,
|
||||
integrations = {
|
||||
diffview = true,
|
||||
telescope = true,
|
||||
fzf_lua = true,
|
||||
},
|
||||
}
|
||||
vim.keymap.set('n', '<leader>ng', neogit.open, { noremap = true, silent = true, desc = "Neogit"})
|
||||
23
nvim/plugin/oil.lua
Normal file
23
nvim/plugin/oil.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
if vim.g.did_load_oil_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_oil_plugin = true
|
||||
|
||||
local oil = require('oil')
|
||||
oil.setup({
|
||||
watch_for_changes = true,
|
||||
columns = {
|
||||
"permissions",
|
||||
"size"
|
||||
},
|
||||
view_options = {
|
||||
show_hidden = true
|
||||
},
|
||||
keymaps = {
|
||||
["wq"] = "actions.close"
|
||||
}
|
||||
})
|
||||
vim.keymap.set("n", "<leader>c", oil.toggle_float, {noremap = true, silent = true});
|
||||
vim.keymap.set("n", "<leader>u", "<cmd>UndotreeToggle<cr>")
|
||||
vim.g.undotree_ShortIndicators = 1
|
||||
vim.g.undotree_SetFocusWhenToggle = 1
|
||||
7
nvim/plugin/statuscol.lua
Normal file
7
nvim/plugin/statuscol.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
if vim.g.did_load_diffview_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_diffview_plugin = true
|
||||
require("diffview").setup({
|
||||
use_icons = false,
|
||||
})
|
||||
62
nvim/plugin/telescope.lua
Normal file
62
nvim/plugin/telescope.lua
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
if vim.g.did_load_telescope_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_telescope_plugin = true
|
||||
|
||||
local telescope = require("telescope.builtin")
|
||||
|
||||
-- Fall back to find_files if not in a git repo
|
||||
local project_files = function()
|
||||
local opts = {} -- define here if you want to define something
|
||||
local ok = pcall(telescope.git_files, opts)
|
||||
if not ok then
|
||||
telescope.find_files(opts)
|
||||
end
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader><leader>", telescope.buffers, {noremap = true, silent = true, desc = "Fuzzy find buffers"})
|
||||
vim.keymap.set("n", "<leader>ff", project_files, {noremap = true, silent = true, desc = "Fuzzy find git files"})
|
||||
vim.keymap.set("n", "<leader>fg", telescope.find_files, {noremap = true, silent = true, desc = "Fuzzy find files"})
|
||||
vim.keymap.set("n", "<leader>fc", telescope.command_history, {noremap = true, silent = true, desc = "Fuzzy find command_history"})
|
||||
vim.keymap.set("n", "<leader>fa", telescope.live_grep, {noremap = true, silent = true, desc = "Fuzzy find grep"})
|
||||
vim.keymap.set("n", "<leader>f8", telescope.grep_string, {noremap = true, silent = true, desc = "Fuzzy find grep current word"})
|
||||
vim.keymap.set("n", "<leader>fs", telescope.treesitter, {noremap = true, silent = true, desc = "Fuzzy find treesitter objects"})
|
||||
vim.keymap.set("n", "<leader>fq", telescope.quickfix, {noremap = true, silent = true, desc = "Fuzzy find quickfix"})
|
||||
vim.keymap.set("n", "<leader>f<BS>", telescope.resume, {noremap = true, silent = true, desc = "Fuzzy find resume"})
|
||||
|
||||
local telescope = require("telescope")
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
layout_strategy = "vertical",
|
||||
layout_config = { width = .90, },
|
||||
prompt_title = false,
|
||||
results_title = false,
|
||||
preview_title = false,
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
'-L',
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--hidden",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--smart-case"
|
||||
},
|
||||
preview = {
|
||||
treesitter = true,
|
||||
},
|
||||
path_display = {
|
||||
'truncate',
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["wq"] = require("telescope.actions").close,
|
||||
["<Esc>"] = require("telescope.actions").close,
|
||||
["<C-k>"] = require("telescope.actions").move_selection_previous,
|
||||
["<C-j>"] = require("telescope.actions").move_selection_next,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
telescope.load_extension("fzf")
|
||||
65
nvim/plugin/treesitter.lua
Normal file
65
nvim/plugin/treesitter.lua
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
if vim.g.did_load_treesitter_plugin then
|
||||
return
|
||||
end
|
||||
vim.g.did_load_treesitter_plugin = true
|
||||
|
||||
require("nvim-treesitter.configs").setup {
|
||||
ensure_installed = {},
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(_, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KiB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["aa"] = "@statement.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
[']]'] = '@function.outer',
|
||||
[']a'] = '@parameter.inner',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[['] = '@function.outer',
|
||||
['[a'] = '@parameter.inner',
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["s]"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["s["] = "@parameter.inner",
|
||||
},
|
||||
}, },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<CR>',
|
||||
node_incremental = '<TAB>',
|
||||
node_decremental = '<S-TAB>',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require('treesitter-context').setup {
|
||||
max_lines = 3,
|
||||
}
|
||||
3
nvim/plugin/which-key.lua
Normal file
3
nvim/plugin/which-key.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
require('which-key').setup {
|
||||
preset = 'helix'
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue