" Happy yaml configuration au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab au BufRead,BufNewFile *.age set filetype=age autocmd FileType age setlocal noeol nofixeol function AddTemplate(tmpl_file) exe "0read " . a:tmpl_file set nomodified 6 endfunction autocmd BufNewFile shell.nix call AddTemplate("$XDG_DATA_HOME/nvim/templates/shell.nix.tmpl") let g:gutentags_file_list_command = 'git ls-files' " https://github.com/unblevable/quick-scope let g:qs_highlight_on_keys = ['f', 'F', 't', 'T'] " Caddyfile indentation autocmd FileType caddyfile setlocal noexpandtab shiftwidth=8 tabstop=8 softtabstop=8 nolist " GitGutter and vim Magit " inspired by: https://jakobgm.com/posts/vim/git-integration/ " Don't map gitgutter keys automatically, set them ourselves let g:gitgutter_map_keys = 0 " Jump between hunks nmap gn (GitGutterNextHunk) " git next nmap gp (GitGutterPrevHunk) " git previous " Hunk-add and hunk-revert for chunk staging nmap ga (GitGutterStageHunk) " git add (chunk) nmap gu (GitGutterUndoHunk) " git undo (chunk) " Open vimagit pane nnoremap gs :Magit " git status " Push to remote nnoremap gP :! git push " git Push " Quick conflict resolution in git mergetool nvim " http://vimcasts.org/episodes/fugitive-vim-resolving-merge-conflicts-with-vimdiff/ nmap [ :diffget //2 nmap ] :diffget //3 " Auto-FMT rust code on save let g:rustfmt_autosave = 1 " Indenting in html template tags let g:html_indent_style1 = "inc" " yank highlight duration let g:highlightedyank_highlight_duration = 200 " Markdown options let g:vim_markdown_folding_disabled = 1 " nnn let g:nnn#command = 'nnn -d -e -H -r' nmap - :NnnPicker % nmap n :NnnPicker % nmap N :NnnPicker lua <"] = actions.close, }, i = { [''] = multiopen, } }, }, pickers = { find_files = { -- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d. find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, }, }, extensions = { fzf = { fuzzy = true, -- false will only do exact matching override_generic_sorter = true, -- override the generic sorter override_file_sorter = true, -- override the file sorter case_mode = "smart_case", -- or "ignore_case" or "respect_case" } } } telescope.load_extension('fzf') local builtin = require('telescope.builtin') vim.keymap.set('n', 'ff', builtin.find_files, {}) vim.keymap.set('n', 'f/', builtin.live_grep, {}) vim.keymap.set('n', 'f?', builtin.builtin, {}) vim.keymap.set('n', 'fb', builtin.buffers, {}) vim.keymap.set('n', 'fr', builtin.command_history, {}) vim.keymap.set('n', 'fc', builtin.commands, {}) vim.keymap.set('n', 'ft', builtin.treesitter, {}) EOF