2021-07-13 17:05:36 +00:00
|
|
|
let g:gutentags_file_list_command = 'git ls-files'
|
|
|
|
|
2022-03-15 16:20:25 +00:00
|
|
|
" https://github.com/unblevable/quick-scope
|
|
|
|
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
|
|
|
|
|
2021-05-30 19:10:28 +00:00
|
|
|
" 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 <Leader>gn <Plug>(GitGutterNextHunk) " git next
|
|
|
|
nmap <Leader>gp <Plug>(GitGutterPrevHunk) " git previous
|
|
|
|
|
|
|
|
" Hunk-add and hunk-revert for chunk staging
|
|
|
|
nmap <Leader>ga <Plug>(GitGutterStageHunk) " git add (chunk)
|
|
|
|
nmap <Leader>gu <Plug>(GitGutterUndoHunk) " git undo (chunk)
|
|
|
|
|
|
|
|
" Open vimagit pane
|
|
|
|
nnoremap <leader>gs :Magit<CR> " git status
|
|
|
|
|
|
|
|
" Quick conflict resolution in git mergetool nvim
|
|
|
|
" http://vimcasts.org/episodes/fugitive-vim-resolving-merge-conflicts-with-vimdiff/
|
|
|
|
nmap <Leader>[ :diffget //2<CR>
|
|
|
|
nmap <Leader>] :diffget //3<CR>
|
2021-11-29 18:06:10 +00:00
|
|
|
|
|
|
|
" 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
|
|
|
|
|
2023-07-13 13:53:10 +00:00
|
|
|
" nnn
|
|
|
|
let g:nnn#command = 'nnn -d -e -H -r'
|
2024-08-18 22:07:22 +00:00
|
|
|
|
|
|
|
nmap - :NnnPicker %<CR>
|
|
|
|
nmap <leader>n :NnnPicker %<CR>
|
|
|
|
nmap <leader>N :NnnPicker<CR>
|
|
|
|
|
|
|
|
lua <<EOF
|
|
|
|
local actions = require("telescope.actions")
|
|
|
|
local telescope = require("telescope")
|
|
|
|
telescope.setup{
|
|
|
|
defaults = {
|
|
|
|
mappings = {
|
|
|
|
n = {
|
2024-08-18 22:23:24 +00:00
|
|
|
["k"] = actions.move_selection_next,
|
|
|
|
["i"] = actions.move_selection_previous,
|
|
|
|
["I"] = actions.move_to_top,
|
|
|
|
["K"] = actions.move_to_bottom,
|
|
|
|
["<C-c>"] = actions.close,
|
2024-08-18 22:07:22 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-08-18 22:23:24 +00:00
|
|
|
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/*" },
|
|
|
|
},
|
|
|
|
},
|
2024-08-18 22:07:22 +00:00
|
|
|
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', '<leader>ff', builtin.find_files, {})
|
|
|
|
vim.keymap.set('n', '<leader>f/', builtin.live_grep, {})
|
|
|
|
vim.keymap.set('n', '<leader>f?', builtin.builtin, {})
|
2024-08-18 22:23:24 +00:00
|
|
|
vim.keymap.set('n', '<leader>fr', builtin.command_history, {})
|
2024-08-18 22:07:22 +00:00
|
|
|
vim.keymap.set('n', '<leader>fc', builtin.commands, {})
|
|
|
|
vim.keymap.set('n', '<leader>ft', builtin.treesitter, {})
|
|
|
|
EOF
|