2020-07-26 20:15:21 +00:00
|
|
|
" Vim Config
|
|
|
|
|
2020-07-31 04:02:41 +00:00
|
|
|
" Plugins
|
|
|
|
call plug#begin('~/.config/nvim/plugged')
|
|
|
|
|
|
|
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } " Required for fuzzyfinder
|
|
|
|
Plug 'junegunn/fzf.vim' " Actual fuzzyfinder
|
2020-07-31 13:28:06 +00:00
|
|
|
Plug 'tpope/vim-surround' " Enables paren editing
|
|
|
|
Plug 'Raimondi/delimitMate' " Auto-close parentheses
|
|
|
|
Plug 'tpope/vim-commentary' " Use gc or gcc to comment
|
2020-07-31 04:02:41 +00:00
|
|
|
Plug 'hashivim/vim-terraform' " Terraform HCL syntax
|
|
|
|
Plug 'vimwiki/vimwiki' " Wiki System
|
2020-07-31 13:40:30 +00:00
|
|
|
Plug 'jreybert/vimagit' " Git GUI
|
2020-07-31 04:02:41 +00:00
|
|
|
|
|
|
|
call plug#end()
|
|
|
|
|
|
|
|
" Settings
|
|
|
|
filetype plugin on " Load the plugin for current filetype (vimwiki)
|
2020-07-26 20:15:21 +00:00
|
|
|
syntax enable " Syntax highlighting
|
|
|
|
set termguicolors " Set to truecolor
|
|
|
|
colorscheme gruvbox " Installed in autoload/ and colors/
|
|
|
|
|
|
|
|
set number " Show line numbers
|
|
|
|
set relativenumber " Relative numbers instead of absolute
|
2020-07-31 13:39:17 +00:00
|
|
|
set list " Reveal whitespace with ---
|
2020-07-26 20:15:21 +00:00
|
|
|
set expandtab " Tabs into spaces
|
2020-07-27 17:00:26 +00:00
|
|
|
set shiftwidth=4 " Amount to shift with > key
|
|
|
|
set softtabstop=4 " Amount to shift with TAB key
|
2020-07-26 20:15:21 +00:00
|
|
|
set ignorecase " Ignore case when searching
|
|
|
|
set smartcase " Check case when using capitals in search
|
|
|
|
set incsearch " Search while typing
|
2020-06-03 14:31:58 +00:00
|
|
|
set pastetoggle=<F3>
|
2020-07-31 04:02:41 +00:00
|
|
|
set visualbell " No sounds
|
|
|
|
set scrolljump=1 " Scroll more than one line (or 1 line)
|
|
|
|
set scrolloff=3 " Margin of lines when scrolling
|
2020-06-03 14:31:58 +00:00
|
|
|
|
2020-07-27 17:00:26 +00:00
|
|
|
set clipboard+=unnamedplus " Uses system clipboard for yanking
|
|
|
|
|
2020-07-26 20:15:21 +00:00
|
|
|
" Remember last position
|
2020-06-03 14:31:58 +00:00
|
|
|
if has("autocmd")
|
|
|
|
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
|
|
|
endif
|
|
|
|
|
2020-07-27 17:00:26 +00:00
|
|
|
" Line type
|
2020-06-03 14:31:58 +00:00
|
|
|
let &t_ti.="\e[1 q"
|
|
|
|
let &t_SI.="\e[5 q"
|
|
|
|
let &t_EI.="\e[1 q"
|
|
|
|
let &t_te.="\e[0 q"
|
|
|
|
|
2020-07-26 20:15:21 +00:00
|
|
|
" Better backup, swap and undo storage
|
|
|
|
set noswapfile " Instead of swaps, create backups (less annoying)
|
|
|
|
set backup " Easier to recover and more secure
|
|
|
|
set undofile " Keeps undos after quit
|
2020-07-31 04:02:41 +00:00
|
|
|
set backupdir=~/.config/nvim/dirs/backup
|
|
|
|
set undodir=~/.config/vim/dirs/undo
|
2020-07-26 20:15:21 +00:00
|
|
|
|
|
|
|
" Create backup directories if they don't exist
|
2020-06-03 14:31:58 +00:00
|
|
|
if !isdirectory(&backupdir)
|
|
|
|
call mkdir(&backupdir, "p")
|
|
|
|
endif
|
|
|
|
if !isdirectory(&undodir)
|
|
|
|
call mkdir(&undodir, "p")
|
|
|
|
endif
|
|
|
|
|
2020-07-31 13:28:06 +00:00
|
|
|
" Map the leader key
|
|
|
|
map <Space> <Leader>
|
|
|
|
|
|
|
|
" Jump to text in this directory
|
|
|
|
nnoremap <Leader>t :Rg<CR>
|
|
|
|
|
|
|
|
" Open file in this directory
|
|
|
|
nnoremap <Leader>f :Files<cr>
|
|
|
|
|
|
|
|
" Switch between multiple open files
|
|
|
|
nnoremap <Leader>b :Buffers<cr>
|
|
|
|
|
|
|
|
" Jump to text in this file
|
|
|
|
nnoremap <Leader>s :BLines<cr>
|
|
|
|
|
2020-07-26 20:15:21 +00:00
|
|
|
" Mouse interaction / scrolling
|
2020-06-08 00:16:03 +00:00
|
|
|
set mouse=nv
|
2020-06-03 14:31:58 +00:00
|
|
|
|
2020-07-26 20:15:21 +00:00
|
|
|
" Change title
|
2020-06-03 14:31:58 +00:00
|
|
|
let &titlestring = @%
|
|
|
|
set title
|
2020-07-26 20:15:21 +00:00
|
|
|
|
2020-07-31 04:02:41 +00:00
|
|
|
" Terraform Plugin
|
|
|
|
let g:terraform_fmt_on_save=1
|
|
|
|
|
|
|
|
" VimWiki Plugin
|
|
|
|
let g:vimwiki_list = [{'path': '~/Documents/notes/',
|
|
|
|
\ 'syntax': 'markdown', 'ext': '.md'}]
|
|
|
|
|