-
Notifications
You must be signed in to change notification settings - Fork 2
/
nvimrc
143 lines (106 loc) · 4.8 KB
/
nvimrc
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
" Vundle Stuff
" -----------------------------------------------------------------------------
set rtp+=~/.nvim/bundle/Vundle.vim
call vundle#begin("~/.nvim/bundle")
" Vundle
Plugin 'gmarik/Vundle.vim'
" Colorschemes
Plugin 'nanotech/jellybeans.vim'
Plugin 'flazz/vim-colorschemes'
" Plugins
Plugin 'Lokaltog/vim-powerline'
Plugin 'kien/ctrlp.vim'
Plugin 'klen/python-mode'
Plugin 'ervandew/supertab'
Plugin 'lepture/vim-jinja'
call vundle#end()
" Display
" -----------------------------------------------------------------------------
" set number
" set foldcolumn=2 " display up to 4 folds
" set nowrap " Prevent wrapping
set title " display title in X.
colorscheme jellybeans
" Vim Settings
" -----------------------------------------------------------------------------
filetype plugin indent on " required
set nocompatible " be iMproved
filetype off " vundle required
set encoding=utf-8 " use UTF-8
set t_Co=256 " 256 colours
set background=dark " the darker the better
syntax on " syntax highlighting
" Powerline specific
" -----------------------------------------------------------------------------
set laststatus=2 " always show status bar
set cmdheight=2 " set cmd height to 2
let g:Powerline_symbols = 'fancy'
" Indentation settings
" -----------------------------------------------------------------------------
set autoindent " always set autoindenting on
set shiftwidth=4 " Force indentation to be 4 spaces
set tabstop=4 " -- idem --
set list " EOL, trailing spaces, tabs: show them.
set lcs=tab:├─ " Tabs are shown as ├──
set lcs+=trail:␣ " Show trailing spaces as ␣
set expandtab " always expand tabs to spaces
set backspace=2 " make backspace behave like in most other apps
" Visual Mode settings
" -----------------------------------------------------------------------------
set hlsearch " Hightlight searches
set ignorecase " Ignore case when searching
set smartcase " Override the ignorecase when search
" contains upper letters
vnoremap < <gv " indent '>' multiple times in visual mode
vnoremap > >gv " indent '<' multiple times in visual mode
"nnoremap n nzz " on next find center screen
" Code Style settings
" -----------------------------------------------------------------------------
"
" Folding
"
set foldmethod=indent " Folding method
set foldlevel=99 " Folding level
nnoremap <space> za " Open up folding
vnoremap <space> zf " Close folding
"
" Text Bubbling (http://vimcasts.org/episodes/bubbling-text/)
"
nmap <C-Up> ddkP " Single line up
nmap <C-Down> ddp " Single line down
vmap <C-Up> xkP`[V`] " Visual mode multiple lines up
vmap <C-Down> xp`[V`] " Visual mode multiple lines down
" python-mode settings
" -----------------------------------------------------------------------------
set completeopt-=preview " Do not pop up pydoc on completing
let g:pymode_folding = 1
let g:pymode_lint_checker = "pyflakes,pep8,mccabe"
let g:pymode_lint_mccabe_complexity = 9
let g:pymode_doc = 0
let g:pymode_rope = 0
let g:pymode_rope_complete_on_dot = 0
" Keyboard maps
" -----------------------------------------------------------------------------
set pastetoggle=<F2> " F2 for paste mode
nnoremap <F3> :set hlsearch!<CR> " Activate or disactive Search Highlighting
let mapleader = "," " , is easier to reach than the default
map <Leader>a ggVG " select all
vmap Q gq " wrap 80col paragraph vertically
" Compile RestructeredText with rst2html
" -----------------------------------------------------------------------------
function! Compilerst()
execute 'silent !rst2html % > /tmp/rsttemp.html'
execute 'silent !firefox /tmp/rsttemp.html &'
execute 'redraw!'
endfunction
nnoremap <F7> :call Compilerst()<CR>
" Spell check per filetype
" -----------------------------------------------------------------------------
autocmd BufRead,BufNewFile *.md setlocal spell spelllang=en_us
autocmd BufRead,BufNewFile *.rst setlocal spell spelllang=en_us
autocmd BufRead,BufNewFile *.txt setlocal spell spelllang=en_us
autocmd FileType gitcommit setlocal spell spelllang=en_us
" Specific settings for filetypes
" -----------------------------------------------------------------------------
autocmd BufRead,BufNewFile *.rst setlocal tw=80
autocmd FileType javascript set tabstop=2 sw=2