mirror of
https://codeberg.org/Mo8it/dotfiles.git
synced 2025-01-01 15:39:20 +00:00
Upgrade to nvim 0.7
This commit is contained in:
parent
dd4d5b842c
commit
7da654e964
3 changed files with 41 additions and 31 deletions
|
@ -1,10 +1,8 @@
|
|||
local map = vim.api.nvim_set_keymap
|
||||
local set = vim.keymap.set
|
||||
local opts = {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
}
|
||||
local e_opts = {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
expr = true,
|
||||
}
|
||||
|
@ -16,46 +14,51 @@ end
|
|||
|
||||
--
|
||||
|
||||
map("", "<Space>", "<Nop>", opts)
|
||||
set("", "<Space>", "<Nop>", opts)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- For navigation with soft wrap
|
||||
map("n", "j", "v:count == 0 ? 'gj' : 'j'", e_opts)
|
||||
map("n", "k", "v:count == 0 ? 'gk' : 'k'", e_opts)
|
||||
set("n", "j", "v:count == 0 ? 'gj' : 'j'", e_opts)
|
||||
set("n", "k", "v:count == 0 ? 'gk' : 'k'", e_opts)
|
||||
|
||||
--
|
||||
|
||||
map("n", "<C-k>", cmd("BufferLineCycleNext"), opts)
|
||||
map("n", "<C-j>", cmd("BufferLineCyclePrev"), opts)
|
||||
set("n", "<C-k>", cmd("BufferLineCycleNext"), opts)
|
||||
set("n", "<C-j>", cmd("BufferLineCyclePrev"), opts)
|
||||
|
||||
map("n", "<C-b>", cmd("Neotree"), opts)
|
||||
set("n", "<C-b>", cmd("Neotree"), opts)
|
||||
|
||||
-- Telescope
|
||||
map("n", "<C-p>", cmd("lua require('plugins.telescope').custom_find_files()"), opts)
|
||||
map("n", "<C-h>", cmd("lua require('plugins.telescope').custom_find_hidden_files()"), opts)
|
||||
map("n", "<C-f>", cmd("lua require('telescope.builtin').current_buffer_fuzzy_find()"), opts)
|
||||
local custom_telescope = require("plugins.telescope")
|
||||
local builtin_telescope = require("telescope.builtin")
|
||||
set("n", "<C-p>", custom_telescope.custom_find_files, opts)
|
||||
set("n", "<C-h>", custom_telescope.custom_find_hidden_files, opts)
|
||||
set("n", "<C-f>", builtin_telescope.current_buffer_fuzzy_find, opts)
|
||||
--
|
||||
map("n", "<space>f", cmd("lua require('telescope.builtin').live_grep()"), opts)
|
||||
map("n", "<space>s", cmd("lua require('telescope.builtin').lsp_document_symbols()"), opts)
|
||||
map("n", "<space>d", cmd("lua require('telescope.builtin').lsp_definitions()"), opts)
|
||||
map("n", "<space>r", cmd("lua require('telescope.builtin').lsp_references()"), opts)
|
||||
set("n", "<space>f", builtin_telescope.live_grep, opts)
|
||||
set("n", "<space>s", builtin_telescope.lsp_document_symbols, opts)
|
||||
set("n", "<space>d", builtin_telescope.lsp_definitions, opts)
|
||||
set("n", "<space>r", builtin_telescope.lsp_references, opts)
|
||||
|
||||
-- LSP
|
||||
map("n", "<space>h", cmd("lua vim.lsp.buf.hover()"), opts)
|
||||
set("n", "<space>h", vim.lsp.buf.hover, opts)
|
||||
|
||||
-- Focus
|
||||
vim.api.nvim_set_keymap("n", "<C-l>", cmd("lua require('focus').split_cycle()"), opts)
|
||||
local focus = require("focus")
|
||||
set("n", "L", focus.split_cycle, opts)
|
||||
|
||||
-- hlslens
|
||||
map("n", "n", [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]], opts)
|
||||
map("n", "N", [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]], opts)
|
||||
map("n", "*", [[*<Cmd>lua require('hlslens').start()<CR>]], opts)
|
||||
map("n", "#", [[#<Cmd>lua require('hlslens').start()<CR>]], opts)
|
||||
map("n", "g*", [[g*<Cmd>lua require('hlslens').start()<CR>]], opts)
|
||||
map("n", "g#", [[g#<Cmd>lua require('hlslens').start()<CR>]], opts)
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local map_opts = {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
}
|
||||
--
|
||||
map("x", "*", [[*<Cmd>lua require('hlslens').start()<CR>]], opts)
|
||||
map("x", "#", [[#<Cmd>lua require('hlslens').start()<CR>]], opts)
|
||||
map("x", "g*", [[g*<Cmd>lua require('hlslens').start()<CR>]], opts)
|
||||
map("x", "g#", [[g#<Cmd>lua require('hlslens').start()<CR>]], opts)
|
||||
map("n", "n", [[<Cmd>execute('normal! ' . v:count1 . 'n')<CR><Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
||||
map("n", "N", [[<Cmd>execute('normal! ' . v:count1 . 'N')<CR><Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
||||
map("n", "*", [[*<Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
||||
map("n", "#", [[#<Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
||||
--
|
||||
map("x", "*", [[*<Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
||||
map("x", "#", [[#<Cmd>lua require('hlslens').start()<CR>]], map_opts)
|
||||
|
|
|
@ -39,8 +39,17 @@ opt.confirm = true
|
|||
|
||||
opt.linebreak = true
|
||||
|
||||
opt.laststatus = 3
|
||||
|
||||
-- Highlight on yank
|
||||
vim.cmd([[au TextYankPost * silent! lua vim.highlight.on_yank {timeout=1200}]])
|
||||
local function custom_highlight_on_yank()
|
||||
return vim.highlight.on_yank({ timeout = 1200 })
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
pattern = "*",
|
||||
callback = custom_highlight_on_yank,
|
||||
})
|
||||
|
||||
-- Disable diagnostics
|
||||
vim.diagnostic.disable()
|
||||
|
|
|
@ -26,7 +26,6 @@ return require("packer").startup(function()
|
|||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
tag = "nvim-0.6",
|
||||
})
|
||||
--
|
||||
use({
|
||||
|
@ -66,7 +65,6 @@ return require("packer").startup(function()
|
|||
-- Comment
|
||||
use({
|
||||
"numToStr/Comment.nvim",
|
||||
tag = "v0.6",
|
||||
})
|
||||
|
||||
-- Todo-comment
|
||||
|
|
Loading…
Reference in a new issue