commit 4e0465c9e7e0a87d30a35937b0769d0c63947c01
Author: Paul Schulze
Date: Fri Mar 22 07:55:36 2024 +0100
nvpunk pfs config: initial commit
diff --git a/init.lua b/init.lua
new file mode 100644
index 0000000..a538b0e
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,125 @@
+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', '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', '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.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 })
+
+
+--map NERDCommenterToggle
+--map NERDCommenterSexy
+--nnoremap s :CocFzfList snippets
diff --git a/plugins.lua b/plugins.lua
new file mode 100644
index 0000000..107c1be
--- /dev/null
+++ b/plugins.lua
@@ -0,0 +1,4 @@
+return {
+ { 'tpope/vim-fugitive' },
+ { 'ibhagwan/fzf-lua' }
+}