Compare commits
3 Commits
66d4b793b7
...
864d76ed7d
Author | SHA1 | Date | |
---|---|---|---|
864d76ed7d | |||
4cc7fbe714 | |||
07448abd59 |
@ -6,7 +6,9 @@ vim.diagnostic.config({
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
lsp.default_keymaps({buffer = bufnr})
|
||||
-- set tagfunc to empty to use default tag jumpingn behaviour withouth going through the lsp
|
||||
-- Set tagfunc back to empty instead of vim.lsp.tagfunc(),
|
||||
-- to use default tag jumping behaviour withouth going through the lsp.
|
||||
-- - see https://neovim.io/doc/user/lsp.html
|
||||
vim.opt.tagfunc = ""
|
||||
end)
|
||||
|
||||
|
@ -1,5 +1,48 @@
|
||||
vim.g.mapleader = " "
|
||||
-- fzf intergration
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
vim.keymap.set("n", "<leader>f", vim.cmd.Files)
|
||||
vim.keymap.set("n", "<leader>t", vim.cmd.Tags)
|
||||
vim.keymap.set("n", "<leader>rg", vim.cmd.Rg)
|
||||
vim.keymap.set("n", "<leader>ff", vim.cmd.Files)
|
||||
vim.keymap.set("n", "<leader>ft", vim.cmd.Tags)
|
||||
vim.keymap.set("n", "<leader>fr", vim.cmd.Rg)
|
||||
--
|
||||
-- Vim argument list bindings
|
||||
--
|
||||
-- Generate list of arg action callbacks, which then executes vim.cmd.args()
|
||||
-- to show argument list aftter performing normal argument action
|
||||
--
|
||||
-- pcall() is used to catch errors, but not do anything with them
|
||||
local arg_actions = {
|
||||
"argu",
|
||||
"next",
|
||||
"prev",
|
||||
"first",
|
||||
"last",
|
||||
}
|
||||
local arg_action = {}
|
||||
for _, action in ipairs(arg_actions) do
|
||||
arg_action[action] = function()
|
||||
pcall(vim.cmd, action)
|
||||
vim.cmd.args()
|
||||
end
|
||||
end
|
||||
-- Generate list of callbacks that execute argu n from n = 1 to 4
|
||||
-- argu_n[n] is a function that executes vim.cmd.argu(n)
|
||||
local argu_n = {}
|
||||
for n = 1, 4 do
|
||||
argu_n[n] = function()
|
||||
pcall(vim.cmd.argu, {n, bang=true})
|
||||
vim.cmd.args()
|
||||
end
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<leader>a", vim.cmd.args)
|
||||
vim.keymap.set("n", "<leader>u", arg_action["argu"])
|
||||
vim.keymap.set("n", "<leader>an", arg_action["next"])
|
||||
vim.keymap.set("n", "<leader>ap", arg_action["prev"])
|
||||
vim.keymap.set("n", "<leader>af", arg_action["first"])
|
||||
vim.keymap.set("n", "<leader>al", arg_action["last"])
|
||||
vim.keymap.set("n", "<leader>aa", argu_n[1])
|
||||
vim.keymap.set("n", "<leader>ra", argu_n[1])
|
||||
vim.keymap.set("n", "<leader>ar", argu_n[2])
|
||||
vim.keymap.set("n", "<leader>as", argu_n[3])
|
||||
vim.keymap.set("n", "<leader>at", argu_n[4])
|
||||
|
@ -14,5 +14,6 @@ vim.opt.undodir = os.getenv("HOME") .. "/.config/nvim/.undodir"
|
||||
vim.opt.undofile = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
-- set sign col to hide if there is no warning/error etc.
|
||||
vim.opt.signcolumn = 'auto:1'
|
||||
-- 'auto:1 sets signcolumn to hide if there is no warning/error etc.
|
||||
-- 'no' disables signcolumn
|
||||
vim.opt.signcolumn = 'no'
|
||||
|
Loading…
Reference in New Issue
Block a user