summaryrefslogtreecommitdiff
path: root/nvim/nvim/lua/mappings.lua
blob: 84b27d6f51ecc8d10f333e94dc5ceb4e4c447ec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
-- 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.localleader=","

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.api.nvim_create_user_command('MakeTags', '!ctags -R .', {})
vim.api.nvim_create_user_command('Sgrep', 'silent grep! <args> | copen 10', {nargs= '+'})