Update nvim config
This commit is contained in:
parent
daa1f37b45
commit
4ff50f6a25
|
@ -1,17 +1,16 @@
|
|||
vim.g.mapleader = " "
|
||||
|
||||
-- Lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
@ -19,21 +18,20 @@ vim.opt.rtp:prepend(lazypath)
|
|||
require("sets")
|
||||
|
||||
require("lazy").setup("plugins", {
|
||||
change_detection = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd([[colorscheme gruvbox]])
|
||||
|
||||
-- Import additional config files
|
||||
require("sets")
|
||||
require("mappings")
|
||||
require("git")
|
||||
require("lsp")
|
||||
require("line")
|
||||
|
||||
require('telescope').load_extension('projects')
|
||||
require('telescope').load_extension('fzf')
|
||||
require('project_nvim').setup({})
|
||||
require("telescope").load_extension("projects")
|
||||
require("telescope").load_extension("fzf")
|
||||
require("project_nvim").setup({})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
vim.api.nvim_create_autocmd({"FocusGained"}, {
|
||||
pattern = {"*"},
|
||||
command = "checktime",
|
||||
vim.api.nvim_create_autocmd({ "FocusGained" }, {
|
||||
pattern = { "*" },
|
||||
command = "checktime",
|
||||
})
|
||||
|
|
|
@ -1,68 +1,76 @@
|
|||
require('gitsigns').setup{
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signcolumn = true, -- :Gitsigns toggle_signs
|
||||
numhl = false, -- :Gitsigns toggle_numhl
|
||||
linehl = false, -- :Gitsigns toggle_linehl
|
||||
word_diff = false, -- :Gitsigns toggle_word_diff
|
||||
watch_gitdir = {
|
||||
follow_files = true
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'right_align', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 100,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter = '<abbrev_sha> - <author> <author_time:%Y-%m-%d>',
|
||||
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
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
require("gitsigns").setup({
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
untracked = { text = "┆" },
|
||||
},
|
||||
signcolumn = true, -- :Gitsigns toggle_signs
|
||||
numhl = false, -- :Gitsigns toggle_numhl
|
||||
linehl = false, -- :Gitsigns toggle_linehl
|
||||
word_diff = false, -- :Gitsigns toggle_word_diff
|
||||
watch_gitdir = {
|
||||
follow_files = true,
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "right_align", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 100,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter = "<abbrev_sha> - <author> <author_time:%Y-%m-%d>",
|
||||
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,
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map('n', ']c', function()
|
||||
if vim.wo.diff then return ']c' end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, {expr=true})
|
||||
-- Navigation
|
||||
map("n", "]c", function()
|
||||
if vim.wo.diff then
|
||||
return "]c"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.next_hunk()
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true })
|
||||
|
||||
map('n', '[c', function()
|
||||
if vim.wo.diff then return '[c' end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return '<Ignore>'
|
||||
end, {expr=true})
|
||||
map("n", "[c", function()
|
||||
if vim.wo.diff then
|
||||
return "[c"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.prev_hunk()
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true })
|
||||
|
||||
-- Actions
|
||||
map('n', '<leader>hs', gs.stage_hunk)
|
||||
map('n', '<leader>hu', gs.undo_stage_hunk)
|
||||
map('n', '<leader>hS', gs.stage_buffer)
|
||||
map('n', '<leader>hR', gs.reset_buffer)
|
||||
map('n', '<leader>tb', gs.toggle_current_line_blame)
|
||||
map('n', '<leader>td', gs.toggle_deleted)
|
||||
end
|
||||
}
|
||||
-- Actions
|
||||
map("n", "<leader>hs", gs.stage_hunk)
|
||||
map("n", "<leader>hu", gs.undo_stage_hunk)
|
||||
map("n", "<leader>hS", gs.stage_buffer)
|
||||
map("n", "<leader>hR", gs.reset_buffer)
|
||||
map("n", "<leader>tb", gs.toggle_current_line_blame)
|
||||
map("n", "<leader>td", gs.toggle_deleted)
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -1,106 +1,105 @@
|
|||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'gruvbox',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
show_filename_only = false,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {
|
||||
{
|
||||
'filename',
|
||||
file_status = true, -- Displays file status (readonly status, modified status)
|
||||
newfile_status = false, -- Display new file status (new file means no write after created)
|
||||
path = 1, -- 0: Just the filename
|
||||
-- 1: Relative path
|
||||
-- 2: Absolute path
|
||||
-- 3: Absolute path, with tilde as the home directory
|
||||
-- 4: Filename and parent dir, with tilde as the home directory
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "gruvbox",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
show_filename_only = false,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch", "diff", "diagnostics" },
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
file_status = true, -- Displays file status (readonly status, modified status)
|
||||
newfile_status = false, -- Display new file status (new file means no write after created)
|
||||
path = 1, -- 0: Just the filename
|
||||
-- 1: Relative path
|
||||
-- 2: Absolute path
|
||||
-- 3: Absolute path, with tilde as the home directory
|
||||
-- 4: Filename and parent dir, with tilde as the home directory
|
||||
|
||||
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
|
||||
-- for other components. (terrible name, any suggestions?)
|
||||
symbols = {
|
||||
modified = '[+]', -- Text to show when the file is modified.
|
||||
readonly = '[-]', -- Text to show when the file is non-modifiable or readonly.
|
||||
unnamed = '[No Name]', -- Text to show for unnamed buffers.
|
||||
newfile = '[New]', -- Text to show for newly created file before first write
|
||||
}
|
||||
}
|
||||
},
|
||||
lualine_x = {
|
||||
'filetype',
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
cond = require("lazy.status").has_updates,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
|
||||
-- for other components. (terrible name, any suggestions?)
|
||||
symbols = {
|
||||
modified = "[+]", -- Text to show when the file is modified.
|
||||
readonly = "[-]", -- Text to show when the file is non-modifiable or readonly.
|
||||
unnamed = "[No Name]", -- Text to show for unnamed buffers.
|
||||
newfile = "[New]", -- Text to show for newly created file before first write
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_x = {
|
||||
"filetype",
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
cond = require("lazy.status").has_updates,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
},
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { "filename" },
|
||||
lualine_x = { "location" },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
})
|
||||
|
||||
|
||||
require("bufferline").setup({
|
||||
options = {
|
||||
mode = "buffers",
|
||||
themable = true,
|
||||
numbers = "ordinal",
|
||||
indicator = {
|
||||
icon = '▎', -- this should be omitted if indicator style is not 'icon'
|
||||
style = 'icon',
|
||||
},
|
||||
modified_icon = '●',
|
||||
close_icon = '',
|
||||
left_trunc_marker = '',
|
||||
right_trunc_marker = '',
|
||||
max_name_length = 24,
|
||||
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
|
||||
truncate_names = true, -- whether or not tab names should be truncated
|
||||
tab_size = 18,
|
||||
diagnostics = "nvim_lsp",
|
||||
color_icons = true,
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = false,
|
||||
-- show_close_icon = false,
|
||||
-- show_tab_indicators = true | false,
|
||||
-- show_duplicate_prefix = true | false, -- whether to show duplicate buffer prefix
|
||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||
move_wraps_at_ends = false, -- whether or not the move command "wraps" at the first or last position
|
||||
-- can also be a table containing 2 custom separators
|
||||
-- [focused and unfocused]. eg: { '|', '|' }
|
||||
-- separator_style = "slant" | "slope" | "thick" | "thin" | { 'any', 'any' },
|
||||
-- enforce_regular_tabs = false | true,
|
||||
always_show_bufferline = true,
|
||||
hover = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
options = {
|
||||
mode = "buffers",
|
||||
themable = true,
|
||||
numbers = "ordinal",
|
||||
indicator = {
|
||||
icon = "▎", -- this should be omitted if indicator style is not 'icon'
|
||||
style = "icon",
|
||||
},
|
||||
modified_icon = "●",
|
||||
close_icon = "",
|
||||
left_trunc_marker = "",
|
||||
right_trunc_marker = "",
|
||||
max_name_length = 24,
|
||||
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
|
||||
truncate_names = true, -- whether or not tab names should be truncated
|
||||
tab_size = 18,
|
||||
diagnostics = "nvim_lsp",
|
||||
color_icons = true,
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = false,
|
||||
-- show_close_icon = false,
|
||||
-- show_tab_indicators = true | false,
|
||||
-- show_duplicate_prefix = true | false, -- whether to show duplicate buffer prefix
|
||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||
move_wraps_at_ends = false, -- whether or not the move command "wraps" at the first or last position
|
||||
-- can also be a table containing 2 custom separators
|
||||
-- [focused and unfocused]. eg: { '|', '|' }
|
||||
-- separator_style = "slant" | "slope" | "thick" | "thin" | { 'any', 'any' },
|
||||
-- enforce_regular_tabs = false | true,
|
||||
always_show_bufferline = true,
|
||||
hover = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
@ -5,43 +5,49 @@ require("mason").setup()
|
|||
require("mason-lspconfig").setup({ automatic_installation = true })
|
||||
|
||||
lsp_zero.on_attach(function(_, bufnr)
|
||||
-- see :help lsp-zero-keybindings to learn the available actions
|
||||
lsp_zero.default_keymaps({buffer = bufnr})
|
||||
-- see :help lsp-zero-keybindings to learn the available actions
|
||||
lsp_zero.default_keymaps({ buffer = bufnr })
|
||||
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
vim.keymap.set("n", "<leader>vc", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "<leader>vr", vim.lsp.buf.rename, opts)
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
vim.keymap.set("n", "<leader>vc", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "<leader>vr", vim.lsp.buf.rename, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>en", vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set("n", "<leader>ep", vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set("n", "<leader>ei", vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set("n", "<leader>en", vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set("n", "<leader>ep", vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set("n", "<leader>ei", vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts)
|
||||
|
||||
vim.keymap.set("n", "gr", function() telescope.lsp_references({
|
||||
include_declaration = false,
|
||||
show_line = false,
|
||||
fname_width = 64,
|
||||
}) end, opts)
|
||||
vim.keymap.set("n", "gd", function() telescope.lsp_definitions({
|
||||
show_line = false,
|
||||
fname_width = 64,
|
||||
}) end, opts)
|
||||
vim.keymap.set("n", "gi", function() telescope.lsp_implementations({
|
||||
show_line = false,
|
||||
fname_width = 64,
|
||||
}) end, opts)
|
||||
vim.keymap.set("n", "gr", function()
|
||||
telescope.lsp_references({
|
||||
include_declaration = false,
|
||||
show_line = false,
|
||||
fname_width = 64,
|
||||
})
|
||||
end, opts)
|
||||
vim.keymap.set("n", "gd", function()
|
||||
telescope.lsp_definitions({
|
||||
show_line = false,
|
||||
fname_width = 64,
|
||||
})
|
||||
end, opts)
|
||||
vim.keymap.set("n", "gi", function()
|
||||
telescope.lsp_implementations({
|
||||
show_line = false,
|
||||
fname_width = 64,
|
||||
})
|
||||
end, opts)
|
||||
end)
|
||||
|
||||
lsp_zero.format_on_save({
|
||||
format_opts = {
|
||||
async = true,
|
||||
timeout_ms = 10000,
|
||||
},
|
||||
servers = {
|
||||
["efm"] = {"javascript", "typescript"},
|
||||
["gopls"] = {"go"},
|
||||
["stylua"] = {"lua"},
|
||||
}
|
||||
format_opts = {
|
||||
async = true,
|
||||
timeout_ms = 10000,
|
||||
},
|
||||
servers = {
|
||||
["efm"] = { "javascript", "typescript", "lua" },
|
||||
["gopls"] = { "go" },
|
||||
-- ["stylua"] = {"lua"},
|
||||
},
|
||||
})
|
||||
|
||||
-- Setup LSP servers
|
||||
|
@ -51,56 +57,68 @@ lspconfig.golangci_lint_ls.setup({})
|
|||
lspconfig.gopls.setup({})
|
||||
-- lua
|
||||
lspconfig.lua_ls.setup(lsp_zero.nvim_lua_ls())
|
||||
-- protobuf
|
||||
lspconfig.bufls.setup({})
|
||||
-- python
|
||||
lspconfig.pylsp.setup({})
|
||||
lspconfig.pyright.setup({})
|
||||
-- typescript
|
||||
lspconfig.eslint.setup({})
|
||||
lspconfig.tsserver.setup({})
|
||||
-- efm
|
||||
local stylua = {
|
||||
formatCommand = "stylua -",
|
||||
formatStdin = true,
|
||||
}
|
||||
local prettier = {
|
||||
formatCommand = 'prettierd "${INPUT}"',
|
||||
formatStdin = true,
|
||||
env = {
|
||||
string.format('PRETTIERD_DEFAULT_CONFIG=%s', vim.fn.expand('~/.config/nvim/utils/linter-config/.prettierrc.json')),
|
||||
},
|
||||
formatCommand = 'prettierd "${INPUT}"',
|
||||
formatStdin = true,
|
||||
env = {
|
||||
string.format(
|
||||
"PRETTIERD_DEFAULT_CONFIG=%s",
|
||||
vim.fn.expand("~/.config/nvim/utils/linter-config/.prettierrc.json")
|
||||
),
|
||||
},
|
||||
}
|
||||
local languages = {
|
||||
-- lua = { stylua },
|
||||
typescript = { prettier },
|
||||
javascript = { prettier },
|
||||
json = { prettier },
|
||||
markdown = { prettier },
|
||||
lua = { stylua },
|
||||
typescript = { prettier },
|
||||
javascript = { prettier },
|
||||
json = { prettier },
|
||||
markdown = { prettier },
|
||||
}
|
||||
lspconfig.efm.setup({
|
||||
-- capabilities = capabilities,
|
||||
cmd = { "/home/pavle/.local/share/nvim/mason/bin/efm-langserver" },
|
||||
-- on_attach = on_attach,
|
||||
init_options = { documentFormatting = true },
|
||||
root_dir = vim.loop.cwd,
|
||||
filetypes = vim.tbl_keys(languages),
|
||||
settings = {
|
||||
rootMarkers = { ".git/", ".prettierignore" },
|
||||
lintDebounce = 100,
|
||||
logLevel = 5,
|
||||
logFile = "/home/pavle/efm.log",
|
||||
languages = languages,
|
||||
},
|
||||
single_file_support = true,
|
||||
-- capabilities = capabilities,
|
||||
cmd = { "/home/pavle/.local/share/nvim/mason/bin/efm-langserver" },
|
||||
-- on_attach = on_attach,
|
||||
init_options = { documentFormatting = true },
|
||||
root_dir = vim.loop.cwd,
|
||||
filetypes = vim.tbl_keys(languages),
|
||||
settings = {
|
||||
rootMarkers = { ".git/", ".prettierignore" },
|
||||
lintDebounce = 100,
|
||||
logLevel = 5,
|
||||
logFile = "/home/pavle/efm.log",
|
||||
languages = languages,
|
||||
},
|
||||
single_file_support = true,
|
||||
})
|
||||
-- other
|
||||
-- terraform
|
||||
lspconfig.terraformls.setup({})
|
||||
-- json
|
||||
lspconfig.jsonls.setup({})
|
||||
|
||||
-- Customize keymaps
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- `Enter` key to confirm completion
|
||||
["<CR>"] = cmp.mapping.confirm({select = false}),
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- `Enter` key to confirm completion
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
|
||||
-- Scroll up and down in the completion documentation
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||
})
|
||||
-- Scroll up and down in the completion documentation
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(4),
|
||||
}),
|
||||
})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local opts = {noremap = true, silent = true}
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Colemak bindings
|
||||
vim.keymap.set("", "n", "j", opts)
|
||||
|
@ -24,19 +24,19 @@ vim.keymap.set("", "<BS>", "gg", opts)
|
|||
vim.keymap.set("", "<CR>", "G", opts)
|
||||
vim.keymap.set("", "<Space>", "<NOP>", opts)
|
||||
|
||||
vim.keymap.set("x", "p", "\"_dP", opts)
|
||||
vim.keymap.set("x", "p", '"_dP', opts)
|
||||
|
||||
vim.keymap.set("n", "<tab>", vim.cmd.bn, opts)
|
||||
vim.keymap.set("n", "<s-tab>", vim.cmd.bp, opts)
|
||||
vim.keymap.set("n", "U", vim.cmd.redo, opts)
|
||||
|
||||
-- File operation maps
|
||||
vim.keymap.set("n", "<leader>fd", function ()
|
||||
if vim.bo.filetype == "json" then
|
||||
vim.cmd("%!jq")
|
||||
else
|
||||
vim.cmd.normal('jzgg=G`z')
|
||||
end
|
||||
vim.keymap.set("n", "<leader>fd", function()
|
||||
if vim.inspect(vim.lsp.get_active_clients()) then
|
||||
vim.lsp.buf.format()
|
||||
else
|
||||
vim.cmd.normal("jzgg=G`z")
|
||||
end
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>fs", vim.cmd.w, opts)
|
||||
vim.keymap.set("n", "<leader>fS", vim.cmd.SudaWrite, opts)
|
||||
|
@ -47,7 +47,7 @@ vim.keymap.set("n", "<leader>wq", vim.cmd.wq, opts)
|
|||
vim.keymap.set("n", "<leader>bd", ":bp | bd #<cr>", opts)
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle, opts)
|
||||
|
||||
vim.keymap.set("", "\\", ":let @/ = \"\"<CR>", opts)
|
||||
vim.keymap.set("", "\\", ':let @/ = ""<CR>', opts)
|
||||
|
||||
-- Git
|
||||
vim.keymap.set("n", "<leader>gd", vim.cmd.Gvdiff, opts)
|
||||
|
@ -64,35 +64,38 @@ vim.keymap.set("n", "<leader>wN", ":resize +5<CR>", opts)
|
|||
vim.keymap.set("n", "<leader>wE", ":resize -5<CR>", opts)
|
||||
|
||||
-- Telescope
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = require('telescope.actions').close,
|
||||
},
|
||||
},
|
||||
},
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = require("telescope.actions").close,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local telescope = require('telescope.builtin')
|
||||
local telescope = require("telescope.builtin")
|
||||
|
||||
local files =function() xpcall(
|
||||
function() telescope.git_files{
|
||||
show_untracked = true,
|
||||
use_git_root = false,
|
||||
} end,
|
||||
function() telescope.find_files{
|
||||
hidden = true,
|
||||
} end
|
||||
)end
|
||||
local files = function()
|
||||
xpcall(function()
|
||||
telescope.git_files({
|
||||
show_untracked = true,
|
||||
use_git_root = false,
|
||||
})
|
||||
end, function()
|
||||
telescope.find_files({
|
||||
hidden = true,
|
||||
})
|
||||
end)
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<leader>ff', files, opts)
|
||||
vim.keymap.set('n', '<c-p>', files, opts)
|
||||
vim.keymap.set('n', '<leader>rg', function()
|
||||
telescope.grep_string{ shorten_path = true, word_match = "-w", only_sort_text = true, search = '' }
|
||||
vim.keymap.set("n", "<leader>ff", files, opts)
|
||||
vim.keymap.set("n", "<c-p>", files, opts)
|
||||
vim.keymap.set("n", "<leader>rg", function()
|
||||
telescope.grep_string({ shorten_path = true, word_match = "-w", only_sort_text = true, search = "" })
|
||||
end, opts)
|
||||
vim.keymap.set('n', '<leader>fb', telescope.buffers, opts)
|
||||
vim.keymap.set('n', '<leader>fh', telescope.help_tags, opts)
|
||||
vim.keymap.set("n", "<leader>fb", telescope.buffers, opts)
|
||||
vim.keymap.set("n", "<leader>fh", telescope.help_tags, opts)
|
||||
|
||||
-- Neotest
|
||||
local jester = require("jester")
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {
|
||||
toggler = {
|
||||
---Line-comment toggle keymap
|
||||
line = '<leader>/',
|
||||
---Block-comment toggle keymap
|
||||
block = '<leader>b/',
|
||||
},
|
||||
opleader = {
|
||||
---Line-comment keymap
|
||||
line = '<leader>/',
|
||||
---Block-comment keymap
|
||||
block = '<leader>b/',
|
||||
},
|
||||
},
|
||||
lazy = false,
|
||||
"numToStr/Comment.nvim",
|
||||
opts = {
|
||||
toggler = {
|
||||
---Line-comment toggle keymap
|
||||
line = "<leader>/",
|
||||
---Block-comment toggle keymap
|
||||
block = "<leader>b/",
|
||||
},
|
||||
opleader = {
|
||||
---Line-comment keymap
|
||||
line = "<leader>/",
|
||||
---Block-comment keymap
|
||||
block = "<leader>b/",
|
||||
},
|
||||
},
|
||||
lazy = false,
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
"sindrets/diffview.nvim",
|
||||
"tpope/vim-fugitive",
|
||||
"lewis6991/gitsigns.nvim",
|
||||
"sindrets/diffview.nvim",
|
||||
"tpope/vim-fugitive",
|
||||
}
|
||||
|
|
|
@ -1,64 +1,64 @@
|
|||
return {
|
||||
-- Look and feel
|
||||
{
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
priority = 1000 ,
|
||||
config = true,
|
||||
},
|
||||
{
|
||||
'akinsho/bufferline.nvim',
|
||||
version = "*",
|
||||
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
"nvim-lualine/lualine.nvim",
|
||||
-- Look and feel
|
||||
{
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
priority = 1000,
|
||||
config = true,
|
||||
},
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
version = "*",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
"nvim-lualine/lualine.nvim",
|
||||
|
||||
-- keymaps
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
opts = {}
|
||||
},
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
},
|
||||
"folke/which-key.nvim",
|
||||
-- keymaps
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end,
|
||||
},
|
||||
"folke/which-key.nvim",
|
||||
|
||||
-- functionality
|
||||
'andymass/vim-matchup',
|
||||
'tpope/vim-repeat',
|
||||
'mbbill/undotree',
|
||||
'jdhao/whitespace.nvim',
|
||||
'lambdalisue/suda.vim',
|
||||
'xiyaowong/nvim-cursorword',
|
||||
'ahmedkhalf/project.nvim',
|
||||
'github/copilot.vim',
|
||||
"mfussenegger/nvim-dap",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
{
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
config = function ()
|
||||
require("colorizer").setup()
|
||||
end
|
||||
},
|
||||
{
|
||||
'folke/neodev.nvim',
|
||||
dependencies = {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
},
|
||||
opts = {
|
||||
library = {
|
||||
plugins = {
|
||||
"nvim-dap-ui",
|
||||
},
|
||||
types = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
-- functionality
|
||||
"andymass/vim-matchup",
|
||||
"tpope/vim-repeat",
|
||||
"mbbill/undotree",
|
||||
"jdhao/whitespace.nvim",
|
||||
"lambdalisue/suda.vim",
|
||||
"xiyaowong/nvim-cursorword",
|
||||
"ahmedkhalf/project.nvim",
|
||||
"github/copilot.vim",
|
||||
"mfussenegger/nvim-dap",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
{
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
config = function()
|
||||
require("colorizer").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"folke/neodev.nvim",
|
||||
dependencies = {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
},
|
||||
opts = {
|
||||
library = {
|
||||
plugins = {
|
||||
"nvim-dap-ui",
|
||||
},
|
||||
types = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
return {
|
||||
{'williamboman/mason.nvim'},
|
||||
{'williamboman/mason-lspconfig.nvim'},
|
||||
{ "williamboman/mason.nvim" },
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
|
||||
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'},
|
||||
{'neovim/nvim-lspconfig'},
|
||||
{'hrsh7th/cmp-nvim-lsp'},
|
||||
{'hrsh7th/nvim-cmp'},
|
||||
{'L3MON4D3/LuaSnip'},
|
||||
{ "VonHeikemen/lsp-zero.nvim", branch = "v3.x" },
|
||||
{ "neovim/nvim-lspconfig" },
|
||||
{ "hrsh7th/cmp-nvim-lsp" },
|
||||
{ "hrsh7th/nvim-cmp" },
|
||||
{ "L3MON4D3/LuaSnip" },
|
||||
|
||||
{
|
||||
"ray-x/go.nvim",
|
||||
dependencies = {
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
config = function()
|
||||
require("go").setup()
|
||||
end,
|
||||
event = {"CmdlineEnter"},
|
||||
ft = {"go", "gomod"},
|
||||
build = ":lua require('go.install').update_all_sync()"
|
||||
}
|
||||
{
|
||||
"ray-x/go.nvim",
|
||||
dependencies = {
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
config = function()
|
||||
require("go").setup()
|
||||
end,
|
||||
event = { "CmdlineEnter" },
|
||||
ft = { "go", "gomod" },
|
||||
build = ":lua require('go.install').update_all_sync()",
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
return {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
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',
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
return {
|
||||
{
|
||||
"David-Kunz/jester",
|
||||
config = function()
|
||||
require('jester').setup({
|
||||
cmd = "yarn test -t '$result' $file",
|
||||
terminal_cmd = ":15split | terminal",
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"David-Kunz/jester",
|
||||
config = function()
|
||||
require("jester").setup({
|
||||
cmd = "yarn test -t '$result' $file",
|
||||
terminal_cmd = ":15split | terminal",
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,65 +1,65 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/playground",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
version = false,
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPost", "BufNewFile", "VeryLazy" },
|
||||
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
|
||||
config = function()
|
||||
require'nvim-treesitter.configs'.setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
auto_install = true,
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"go",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"luap",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"terraform",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"yaml",
|
||||
},
|
||||
playground = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
|
||||
persist_queries = false,
|
||||
keybindings = {
|
||||
toggle_query_editor = 'o',
|
||||
toggle_hl_groups = 'i',
|
||||
toggle_injected_languages = 't',
|
||||
toggle_anonymous_nodes = 'a',
|
||||
toggle_language_display = 'I',
|
||||
focus_language = 'f',
|
||||
unfocus_language = 'F',
|
||||
update = 'R',
|
||||
goto_node = '<cr>',
|
||||
show_help = '?',
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/playground",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
version = false,
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPost", "BufNewFile", "VeryLazy" },
|
||||
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
auto_install = true,
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"go",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"luap",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"terraform",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"yaml",
|
||||
},
|
||||
playground = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
|
||||
persist_queries = false,
|
||||
keybindings = {
|
||||
toggle_query_editor = "o",
|
||||
toggle_hl_groups = "i",
|
||||
toggle_injected_languages = "t",
|
||||
toggle_anonymous_nodes = "a",
|
||||
toggle_language_display = "I",
|
||||
focus_language = "f",
|
||||
unfocus_language = "F",
|
||||
update = "R",
|
||||
goto_node = "<cr>",
|
||||
show_help = "?",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -33,4 +33,4 @@ vim.opt.undodir = "/home/pavle/.local/share/nvim/undodir"
|
|||
vim.opt.scrolloff = 8
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.shell = '/usr/bin/zsh'
|
||||
vim.opt.shell = "/usr/bin/zsh"
|
||||
|
|
Loading…
Reference in New Issue