summaryrefslogtreecommitdiff
path: root/nvim/nvim/lua/mappings.lua
blob: 02e42f35457c48b4b0aa7341b7b9ac80f7a48455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- 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.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 .', {})