vim.opt.colorcolumn = '100' vim.opt.undodir = '/home/pfs/.config/nvpunk/undo' vim.opt.undofile = true vim.opt.undolevels = 1000000000 vim.opt.history = 2000 vim.opt.clipboard = 'unnamed,unnamedplus' vim.opt.foldenable = false vim.opt.modeline = true vim.opt.modelines = 3 vim.opt.scrolloff = 10 vim.opt.belloff = 'all' vim.opt.errorbells = false vim.opt.visualbell = false vim.cmd [[nnoremap / /\v]] vim.cmd [[vnoremap / /\v]] -- vim.cmd [[nnoremap ? ?\v]] -- vim.cmd [[vnoremap ? ?\v]] vim.api.nvim_set_keymap('n', 'gi', ':FzfLua lsp_implementations', { noremap = true }) vim.api.nvim_set_keymap('n', 'gr', ':FzfLua lsp_references', { noremap = true }) vim.api.nvim_set_keymap('n', 'gF', ':lua vim.lsp.buf.format()', { noremap = true }) vim.api.nvim_set_keymap('n', 'd', ':FzfLua diagnostics_document', { noremap = true }) vim.api.nvim_set_keymap('n', ']g', ':Gitsigns next_hunk', { noremap = true }) vim.api.nvim_set_keymap('n', '[g', ':Gitsigns prev_hunk', { noremap = true }) vim.api.nvim_set_keymap('n', 'gs', ':Gitsigns preview_hunk_inline', { noremap = true }) vim.api.nvim_set_keymap('n', 'gu', ':Gitsigns reset_hunk', { noremap = true }) vim.api.nvim_set_keymap('n', 'DD', ':DiffviewOpen', { noremap = true }) vim.api.nvim_set_keymap('n', 'DF', ':DiffviewFileHistory', { noremap = true }) vim.keymap.set('n', ']e', function() vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR }) end, { desc = 'Go to next LSP diagnostic error' }) vim.keymap.set('n', '[e', function() vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR }) end, { desc = 'Go to previous LSP diagnostic error' }) vim.keymap.set('n', '', function() vim.lsp.buf.rename() end, { desc = 'LSP Rename symbol under cursor' }) -- Format on save for Rust vim.api.nvim_create_autocmd("BufWritePre", { group = vim.api.nvim_create_augroup("RustAutoFmt", { clear = true }), pattern = { "*.rs" }, callback = function() vim.lsp.buf.format({ async = false }) end, }) require('fzf-lua').setup { lsp = { includeDeclaration = false } } vim.api.nvim_set_keymap('n', '', ':silent noh ', { noremap = true }) vim.api.nvim_set_keymap('n', '', 'gt', { noremap = true }) vim.api.nvim_set_keymap('n', '', 'gT', { noremap = true }) vim.api.nvim_set_keymap('n', '', '"+y', { noremap = true }) vim.api.nvim_set_keymap('v', '', '"+yy', { noremap = true }) vim.api.nvim_set_keymap('n', '', ':q', { noremap = true }) vim.api.nvim_set_keymap('n', ',f', ':FzfLua files', { noremap = true }) vim.api.nvim_set_keymap('n', ',F', ':FzfLua files query=', { noremap = true }) vim.api.nvim_set_keymap('n', 'h', ':tabedit % | ClangdSwitchSourceHeader', { noremap = true }) vim.api.nvim_set_keymap('n', 'H', '/⚡', { noremap = true }) vim.api.nvim_set_keymap('n', 'g', ':Git blame -w', { noremap = true }) -- blines vim.api.nvim_set_keymap('n', 'l', ':FzfLua grep_curbuf', { noremap = true }) vim.api.nvim_set_keymap('n', 'L', ':FzfLua grep_curbuf query=', { noremap = true }) -- ripgrep vim.api.nvim_set_keymap('n', 'r', ':FzfLua live_grep_resume', { noremap = true }) vim.api.nvim_set_keymap('n', ',r', ':FzfLua grep_cword', { noremap = true }) vim.api.nvim_set_keymap('n', ',R', ':FzfLua grep_cWORD', { noremap = true }) -- symbols vim.api.nvim_set_keymap('n', 's', ':FzfLua lsp_document_symbols', { noremap = true }) vim.api.nvim_set_keymap('n', ',M', ':FzfLua lsp_live_workspace_symbols', { noremap = true }) vim.api.nvim_set_keymap('n', ',n', ':silent exec "!ctc"redraw!', { noremap = true }) -- buffers vim.api.nvim_set_keymap('n', 'a', ':FzfLua buffers', { noremap = true }) -- search presets vim.api.nvim_set_keymap('n', ',/', '/\\v|||', { noremap = true }) -- convenience shortcuts vim.api.nvim_set_keymap('n', '', ':w', { noremap = true }) vim.api.nvim_set_keymap('v', '', ':w', { noremap = true }) vim.api.nvim_set_keymap('i', '', ':w', { noremap = true }) -- tabs vim.api.nvim_set_keymap('n', ',,', ':tabe', { noremap = true }) vim.api.nvim_set_keymap('n', '.', ':tab drop %:p:h', { noremap = true }) vim.api.nvim_set_keymap('n', ',t', ':tab drop', { noremap = true }) vim.api.nvim_set_keymap('v', ',t', ':tab drop', { noremap = true }) vim.api.nvim_set_keymap('n', 'q', ':tabclose', { noremap = true }) vim.cmd [[ set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:< ]] vim.cmd [[ let g:rooter_manual_only = 0 let g:rooter_silent_chdir = 1 let g:rooter_patterns = ['.git'] let g:rooter_change_directory_for_non_project_files = 'current' ]] -- vim.opt.shada = "/100,'10,\"100,:20,%" -- vim.opt.shadafile = "/home/pfs/.config/nvpunk/lua/user/nviminfo" -- autocmd BufWinLeave * if expand("%") != "" | silent! mkview | endif -- autocmd BufWinEnter * if expand("%") != "" | silent! loadview | endif --map NERDCommenterToggle --map NERDCommenterSexy --nnoremap s :CocFzfList snippets