1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
-- These functions are shit at the moment: they screw up the search list
function trimWhiteSpace()
vim.cmd("%s/\\s\\+$//")
end
function trimWhiteSpaceVisual()
vim.cmd("'<,'>s/\\s\\+$//")
end
vim.g.mapleader=","
vim.g.maplocalleader=","
vim.keymap.set('n', '<F2>', trimWhiteSpace)
vim.keymap.set('v', '<F2>', trimWhiteSpaceVisual)
-- more natural movement with wrap on
vim.keymap.set('n', 'j', 'gj')
vim.keymap.set('n', 'k', 'gk')
vim.keymap.set('n', 'j', 'gj')
vim.keymap.set('n', 'k', 'gk')
vim.keymap.set('n', 'gm', ':vertical Man ' .. vim.fn.expand '<cword>' .. '<CR>',
{ desc = 'open man page in vertical' })
vim.api.nvim_create_user_command('MakeTags', '!ctags -R .', {})
vim.api.nvim_create_user_command('Sgrep', 'silent grep! <args> | copen 10', {nargs= '+'})
|