summaryrefslogtreecommitdiff
path: root/.config/nvim/init.vim
blob: 48e8da89b0e825edb9b190c6cd2a5f746499d123 (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
set nocompatible

let g:nvim_config_root = expand('<sfile>:p:h')
set rtp+=~/.config/nvim
set rtp+=~/.config/nvim/bundle/Vundle.vim
call vundle#begin('~/.config/nvim/bundle')

Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdcommenter'
Plugin 'tpope/vim-fugitive'
Plugin 'vim-airline/vim-airline'
Plugin 'morhetz/gruvbox'
Plugin 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plugin 'junegunn/fzf.vim'
Plugin 'loremipsum'

call vundle#end()
filetype plugin indent on

syntax on
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set autochdir
set colorcolumn=80,120
set formatprg=par\ -w80
set autoread
au CursorHold,CursorHoldI * checktime
au FocusGained,BufEnter * :checktime

" Enable clipboard buffer to be used as vim buffer
set clipboard=unnamedplus

" Settings for gvim
set guioptions-=m  "remove menu bar
set guioptions-=T  "remove toolbar
set guioptions-=r  "remove right-hand scroll bar
set guioptions-=L  "remove left-hand scroll bar

" Set line numbering rules
set relativenumber number
au InsertEnter * set number norelativenumber
au InsertLeave * set relativenumber

colorscheme gruvbox
set background=dark

let mapleader="\<Space>"

" Remap splits shortcuts
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>

nmap <leader>s <ESC>:vsplit<CR>
nmap <leader>vs <ESC>:split<CR>

" NERDCommenter config
let g:NERDSpaceDelims = 1
let g:NERDCommentEmptyLines = 1
let g:NERDTrimTrailingWhitespace = 1
let g:NERDTreeChDirMode=2

" NERDCommenter shortcuts
nmap <C-\> <leader>c<space>
vmap <C-\> <leader>c<space>

" Only search for files in directory in which vim was opened. 
autocmd VimEnter * let g:basedir=expand("%:p:h")
nmap <C-p> :execute "Files" g:basedir<CR>

" Use of FZF plugin
nmap ; :Buffers<CR>
nmap <C-w> :bd!<CR>

" Calling my script that allows per-project configuration of tasks keybindings
call projector#init()