improve key mappings a bit and add spellcheck

This commit is contained in:
Vladan Popovic 2023-07-03 06:21:05 +02:00
parent b36cad9c7b
commit 97dfc2aa6a

View file

@ -26,15 +26,12 @@ vim.opt.pastetoggle = '<F2>'
vim.opt.shiftwidth = 4 vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4 vim.opt.softtabstop = 4
vim.opt.tabstop = 4 vim.opt.tabstop = 4
vim.opt.textwidth = 125 vim.opt.textwidth = 79
vim.opt.undofile = true vim.opt.undofile = true
-- Enable vimrc files per project and disable unsafe commands in project vimrc -- Enable vimrc files per project and disable unsafe commands in project vimrc
vim.opt.exrc = true vim.opt.exrc = true
vim.opt.secure = true vim.opt.secure = true
vim.cmd 'noremap <tab> :bn<CR>'
vim.cmd 'noremap <S-tab> :bp<CR>'
-- Toggles on different plugins/modes -- Toggles on different plugins/modes
vim.cmd 'nmap <F3> :set nonumber!<CR>' vim.cmd 'nmap <F3> :set nonumber!<CR>'
vim.cmd 'nmap <F5> :NvimTreeToggle<CR>' vim.cmd 'nmap <F5> :NvimTreeToggle<CR>'
@ -54,13 +51,22 @@ vim.cmd 'highlight Pmenu ctermbg=253 guibg=253'
vim.cmd 'highlight Pmenu ctermfg=232 guifg=232' vim.cmd 'highlight Pmenu ctermfg=232 guifg=232'
vim.cmd 'let g:airline_theme=\'papercolor\'' vim.cmd 'let g:airline_theme=\'papercolor\''
-- Find files using Telescope command-line sugar. local keymap = vim.api.nvim_set_keymap
vim.cmd 'nnoremap <leader>ff <cmd>Telescope find_files<cr>' local default_opts = { noremap = true, silent = true }
vim.cmd 'nnoremap <leader>fg <cmd>Telescope live_grep<cr>'
vim.cmd 'nnoremap <leader>fb <cmd>Telescope buffers<cr>'
vim.cmd 'nnoremap <leader>fh <cmd>Telescope help_tags<cr>'
vim.cmd 'nnoremap <leader>fl <cmd>Telescope git_files<cr>'
-- Use tab and shift+tab to cycle buffers
keymap("n", "<tab>", "<cmd>bn<cr>", default_opts)
keymap("n", "<S-tab>", "<cmd>bp<cr>", default_opts)
-- Find files, buffers, grep in folder using Telescope command-line sugar.
keymap("n", "<leader>ff", "<cmd>Telescope find_files<cr>", default_opts)
keymap("n", "<leader>fg", "<cmd>Telescope live_grep<cr>", default_opts)
keymap("n", "<leader>fb", "<cmd>Telescope buffers<cr>", default_opts)
keymap("n", "<leader>fh", "<cmd>Telescope help_tags<cr>", default_opts)
keymap("n", "<leader>fl", "<cmd>Telescope git_files<cr>", default_opts)
-- Turn spellchecker on
keymap("n", "<leader>s", "<cmd>setlocal spell spelllang=en_us<cr>", default_opts)
-- Install plugins -- Install plugins
require('plugins') require('plugins')