✨ Added vim-fugitive and harpoon to nvim config
This commit is contained in:
parent
1aa13410f3
commit
25c98539b9
22 changed files with 449 additions and 384 deletions
|
|
@ -1 +1 @@
|
|||
require('nvim-autopairs').setup()
|
||||
require("nvim-autopairs").setup()
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
require'colorizer'.setup()
|
||||
require("colorizer").setup()
|
||||
|
|
|
|||
10
.config/nvim/after/plugin/harpoon.lua
Normal file
10
.config/nvim/after/plugin/harpoon.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
local mark = require("harpoon.mark")
|
||||
local ui = require("harpoon.ui")
|
||||
|
||||
vim.keymap.set("n", "<leader>a", mark.add_file)
|
||||
vim.keymap.set("n", "<C-o>", ui.toggle_quick_menu)
|
||||
|
||||
vim.keymap.set("n", "<leader>h", function() ui.nav_file(1) end)
|
||||
vim.keymap.set("n", "<leader>j", function() ui.nav_file(2) end)
|
||||
vim.keymap.set("n", "<leader>k", function() ui.nav_file(3) end)
|
||||
vim.keymap.set("n", "<leader>l", function() ui.nav_file(4) end)
|
||||
|
|
@ -1 +1 @@
|
|||
require'nvim-lastplace'.setup{}
|
||||
require("nvim-lastplace").setup({})
|
||||
|
|
|
|||
|
|
@ -3,102 +3,64 @@ local lsp = require("lsp-zero")
|
|||
lsp.preset("recommended")
|
||||
|
||||
lsp.ensure_installed({
|
||||
'tsserver',
|
||||
'eslint',
|
||||
'sumneko_lua',
|
||||
'rust_analyzer',
|
||||
"tsserver",
|
||||
"eslint",
|
||||
"sumneko_lua",
|
||||
"rust_analyzer",
|
||||
})
|
||||
|
||||
-- Fix Undefined global 'vim'
|
||||
lsp.configure('sumneko_lua', {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' }
|
||||
}
|
||||
}
|
||||
}
|
||||
lsp.configure("sumneko_lua", {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp = require("cmp")
|
||||
|
||||
cmp.setup({
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
}
|
||||
})
|
||||
|
||||
local cmp_select = {behavior = cmp.SelectBehavior.Select}
|
||||
local cmp_mappings = lsp.defaults.cmp_mappings({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
})
|
||||
|
||||
-- disable completion with tab
|
||||
-- this helps with copilot setup
|
||||
cmp_mappings['<Tab>'] = nil
|
||||
cmp_mappings['<S-Tab>'] = nil
|
||||
|
||||
lsp.setup_nvim_cmp({
|
||||
mapping = cmp_mappings
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
})
|
||||
|
||||
lsp.set_preferences({
|
||||
suggest_lsp_servers = false,
|
||||
sign_icons = {
|
||||
error = 'E',
|
||||
warn = 'W',
|
||||
hint = 'H',
|
||||
info = 'I'
|
||||
}
|
||||
suggest_lsp_servers = false,
|
||||
sign_icons = {
|
||||
error = "E",
|
||||
warn = "W",
|
||||
hint = "H",
|
||||
info = "I",
|
||||
},
|
||||
})
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
|
||||
if client.name == "eslint" then
|
||||
vim.cmd.LspStop('eslint')
|
||||
return
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set("n", "<leader>vws", vim.lsp.buf.workspace_symbol, opts)
|
||||
vim.keymap.set("n", "<leader>vd", vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set("n", "<leader>vca", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", vim.lsp.buf.references, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts)
|
||||
end)
|
||||
|
||||
-- function that is used with keybinding cm to toggle autocompletion
|
||||
Mode = require('cmp.types').cmp.TriggerEvent.TextChanged
|
||||
Mode = require("cmp.types").cmp.TriggerEvent.TextChanged
|
||||
function SetAutoCmp(mode)
|
||||
if mode then
|
||||
cmp.setup({
|
||||
completion = {
|
||||
autocomplete = { Mode }
|
||||
}
|
||||
})
|
||||
Mode = false
|
||||
else
|
||||
cmp.setup({
|
||||
completion = {
|
||||
autocomplete = Mode
|
||||
}
|
||||
})
|
||||
Mode = require('cmp.types').cmp.TriggerEvent.TextChanged
|
||||
end
|
||||
if mode then
|
||||
cmp.setup({
|
||||
completion = {
|
||||
autocomplete = { Mode },
|
||||
},
|
||||
})
|
||||
Mode = false
|
||||
else
|
||||
cmp.setup({
|
||||
completion = {
|
||||
autocomplete = Mode,
|
||||
},
|
||||
})
|
||||
Mode = require("cmp.types").cmp.TriggerEvent.TextChanged
|
||||
end
|
||||
end
|
||||
SetAutoCmp(Mode)
|
||||
lsp.setup()
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
virtual_text = true,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
require('lualine').setup({
|
||||
options = { them = 'nord' }
|
||||
require("lualine").setup({
|
||||
options = { them = "nord" },
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
vim.g.mkdp_browser = 'librewolf'
|
||||
vim.g.mkdp_theme = 'dark'
|
||||
vim.g.mkdp_browser = "librewolf"
|
||||
vim.g.mkdp_theme = "dark"
|
||||
|
|
|
|||
1
.config/nvim/after/plugin/neoformat.lua
Normal file
1
.config/nvim/after/plugin/neoformat.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
vim.cmd([[let g:shfmt_opt="-ci"]])
|
||||
|
|
@ -1,117 +1,117 @@
|
|||
-- Nvim_Tree configuration: -- setup with all defaults
|
||||
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
|
||||
require'nvim-tree'.setup { -- BEGIN_DEFAULT_OPTS
|
||||
auto_reload_on_write = true,
|
||||
disable_netrw = false,
|
||||
-- hide_root_folder = false,
|
||||
hijack_cursor = false,
|
||||
hijack_netrw = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
ignore_buffer_on_setup = false,
|
||||
open_on_setup = false,
|
||||
open_on_setup_file = false,
|
||||
open_on_tab = false,
|
||||
sort_by = "name",
|
||||
update_cwd = false,
|
||||
view = {
|
||||
width = 25,
|
||||
-- height = 30,
|
||||
side = "right",
|
||||
preserve_window_proportions = true,
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes",
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
-- user mappings go here
|
||||
},
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
icons = {
|
||||
corner = "└ ",
|
||||
edge = "│ ",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
},
|
||||
},
|
||||
hijack_directories = {
|
||||
enable = true,
|
||||
auto_open = true,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = false,
|
||||
update_cwd = false,
|
||||
ignore_list = {},
|
||||
},
|
||||
ignore_ft_on_setup = {},
|
||||
system_open = {
|
||||
cmd = nil,
|
||||
args = {},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = false,
|
||||
show_on_dirs = false,
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warning = "",
|
||||
error = "",
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
custom = {},
|
||||
exclude = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 400,
|
||||
},
|
||||
actions = {
|
||||
use_system_clipboard = true,
|
||||
change_dir = {
|
||||
enable = true,
|
||||
global = false,
|
||||
restrict_above_cwd = false,
|
||||
},
|
||||
open_file = {
|
||||
quit_on_open = false,
|
||||
resize_window = false,
|
||||
window_picker = {
|
||||
enable = true,
|
||||
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
exclude = {
|
||||
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||
buftype = { "nofile", "terminal", "help" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
trash = {
|
||||
cmd = "trash",
|
||||
require_confirm = true,
|
||||
},
|
||||
log = {
|
||||
enable = false,
|
||||
truncate = false,
|
||||
types = {
|
||||
all = false,
|
||||
config = false,
|
||||
copy_paste = false,
|
||||
diagnostics = false,
|
||||
git = false,
|
||||
profile = false,
|
||||
},
|
||||
},
|
||||
} -- END_DEFAULT_OPTS for Nvim_Tree
|
||||
require("nvim-tree").setup({ -- BEGIN_DEFAULT_OPTS
|
||||
auto_reload_on_write = true,
|
||||
disable_netrw = false,
|
||||
-- hide_root_folder = false,
|
||||
hijack_cursor = false,
|
||||
hijack_netrw = true,
|
||||
hijack_unnamed_buffer_when_opening = false,
|
||||
ignore_buffer_on_setup = false,
|
||||
open_on_setup = false,
|
||||
open_on_setup_file = false,
|
||||
open_on_tab = false,
|
||||
sort_by = "name",
|
||||
update_cwd = false,
|
||||
view = {
|
||||
width = 25,
|
||||
-- height = 30,
|
||||
side = "right",
|
||||
preserve_window_proportions = true,
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes",
|
||||
mappings = {
|
||||
custom_only = false,
|
||||
list = {
|
||||
-- user mappings go here
|
||||
},
|
||||
},
|
||||
},
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = false,
|
||||
icons = {
|
||||
corner = "└ ",
|
||||
edge = "│ ",
|
||||
none = " ",
|
||||
},
|
||||
},
|
||||
icons = {
|
||||
webdev_colors = true,
|
||||
},
|
||||
},
|
||||
hijack_directories = {
|
||||
enable = true,
|
||||
auto_open = true,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = false,
|
||||
update_cwd = false,
|
||||
ignore_list = {},
|
||||
},
|
||||
ignore_ft_on_setup = {},
|
||||
system_open = {
|
||||
cmd = nil,
|
||||
args = {},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = false,
|
||||
show_on_dirs = false,
|
||||
icons = {
|
||||
hint = "",
|
||||
info = "",
|
||||
warning = "",
|
||||
error = "",
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
custom = {},
|
||||
exclude = {},
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
ignore = true,
|
||||
timeout = 400,
|
||||
},
|
||||
actions = {
|
||||
use_system_clipboard = true,
|
||||
change_dir = {
|
||||
enable = true,
|
||||
global = false,
|
||||
restrict_above_cwd = false,
|
||||
},
|
||||
open_file = {
|
||||
quit_on_open = false,
|
||||
resize_window = false,
|
||||
window_picker = {
|
||||
enable = true,
|
||||
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||
exclude = {
|
||||
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||
buftype = { "nofile", "terminal", "help" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
trash = {
|
||||
cmd = "trash",
|
||||
require_confirm = true,
|
||||
},
|
||||
log = {
|
||||
enable = false,
|
||||
truncate = false,
|
||||
types = {
|
||||
all = false,
|
||||
config = false,
|
||||
copy_paste = false,
|
||||
diagnostics = false,
|
||||
git = false,
|
||||
profile = false,
|
||||
},
|
||||
},
|
||||
}) -- END_DEFAULT_OPTS for Nvim_Tree
|
||||
|
||||
-- Automatically closes Nvim tree if last window open
|
||||
vim.cmd[[autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]]
|
||||
-- Automatically closes Nvim tree if last window open
|
||||
vim.cmd([[autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif]])
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
-- Enable use of ripgrep
|
||||
require('nvim-ripgrep').setup{
|
||||
runner = require('nvim-ripgrep.run').ripgrep, -- grep command
|
||||
prompt = "❯ ", -- prompt
|
||||
window = {
|
||||
width = 0.8,
|
||||
border = "rounded",
|
||||
};
|
||||
open_qf_fn = function()
|
||||
return vim.api.nvim_command('copen')
|
||||
end,
|
||||
}
|
||||
require("nvim-ripgrep").setup({
|
||||
runner = require("nvim-ripgrep.run").ripgrep, -- grep command
|
||||
prompt = "❯ ", -- prompt
|
||||
window = {
|
||||
width = 0.8,
|
||||
border = "rounded",
|
||||
},
|
||||
open_qf_fn = function()
|
||||
return vim.api.nvim_command("copen")
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,22 +1,53 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {"bash", "c", "c_sharp", "cmake", "cpp", "css", "dockerfile", "go", "html", "http", "java", "javascript", "json", "json5", "jsonc", "lua", "make", "perl", "php", "pug", "python", "regex", "ruby", "toml", "tsx", "typescript", "rust", "vim", "vue", "wgsl", "yaml",},
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"c_sharp",
|
||||
"cmake",
|
||||
"cpp",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"go",
|
||||
"html",
|
||||
"http",
|
||||
"java",
|
||||
"javascript",
|
||||
"json",
|
||||
"json5",
|
||||
"jsonc",
|
||||
"lua",
|
||||
"make",
|
||||
"perl",
|
||||
"php",
|
||||
"pug",
|
||||
"python",
|
||||
"ruby",
|
||||
"toml",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"rust",
|
||||
"vim",
|
||||
"vue",
|
||||
"wgsl",
|
||||
"yaml",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
})
|
||||
|
|
|
|||
1
.config/nvim/after/plugin/undotree.lua
Normal file
1
.config/nvim/after/plugin/undotree.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
Loading…
Add table
Add a link
Reference in a new issue