-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
executable file
·175 lines (140 loc) · 4.68 KB
/
.vimrc
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
" .vimrc
" AUTHOR : Sukkoria
" Last modification : 24.06.2017
" ensures that various options are properly set to work with the Vim-related packages.
runtime! archlinux.vim
" GENERAL
set number " Numbers along the lines
set relativenumber
set background=dark
set title " Title for the window
set lbr! " Don’t cut the words
syntax on
let mapleader=","
let g:mapleader=","
set listchars+=nbsp:_
" Enable type-specific configuration
filetype on
filetype plugin on
" Indenting
"Default to autoindenting of C like languages
"This is overridden per filetype below
set autoindent
filetype indent on
" Show levels of indentation
set listchars=tab:--
"The rest deal with whitespace handling and
"mainly make sure hardtabs are never entered
"as their interpretation is too non standard in my experience
set softtabstop=4
" Note if you don't set expandtab, vi will automatically merge
" runs of more than tabstop spaces into hardtabs. Clever but
" not what I usually want.
set expandtab
set shiftwidth=4
set shiftround
set nojoinspaces
" Auto-completion
set wildmenu " Enable auto-completion
set wildmode=list:longest " Enable shell-like <TAB> auto-completion
set wildignore=*.o,*.a,*.pyc,*.jpg,*.png,*.bmp " Ignore those files
" Show Non-breakable Spaces
highlight NbSp ctermbg=lightgray guibg=lightred
match NbSp /\%xa0/
" When open a new file remember the cursor position of the last
" editing
if has("autocmd")
" When editing a file, always jump to the last cursor
" position
autocmd BufReadPost * if line("'\"") | exe "'\""|endif
endif
" To automatically apply .vimrc modifications
if has("autocmd")
autocmd! bufwritepost .vimrc source ~/.vimrc
endif
" Save file with root permission with w!!
cmap w!! w !sudo tee % > /dev/null
" Save swap files in a specific folder
set backup
set backupcopy=yes
set backupdir=/home/sukkoria/vim-backups
" 1 space, not 2, when joining sentences.
set nojoinspaces
" Duplicate current(s) line(s), notepad++ like
inoremap <leader>d <esc>yypi
nnoremap <leader>d yyp
vnoremap <leader>d 0y0p
" Move current(s) line(s) with ??
" TODO
" SEARCH
" Case-sensitive search
" Only make "/" search case-sensitive when an uppercase letter is present
set ignorecase
set smartcase
" Highlight searched terms
set hlsearch
set incsearch "… dynamically while typing
" MAPPING BÉPO
if !empty(system("setxkbmap -print|grep bepo"))
source ~/.vimrc.bepo
endif
" GRAPHIC CUSTOMISATION
" vim-airline
let g:airline_theme='badwolf'
" Draw a decorative line
" au VimEnter * call CmdAlias('line', 'set fillchars+=stl:\_')
" LATEX
" To use some Wikipedia-like shortcuts and commands
au FileType tex source ~/.vimrc.wikitex
" Compile and show pdf
au FileType tex nnoremap <buffer> <F5> :w
" Folds (principally for big templates)
au FileType tex set foldmethod=marker
" au FileType tex set foldmarker=("<!--","-->")
" PYTHON
au FileType python source ~/.vimrc.python
" JS
au FileType javascript source ~/.vimrc.js
" bash
au FileType sh source ~/.vimrc.sh
" Set folding
"au FileType python :set foldmethod=indent
" POWERLINE
"python from powerline.vim import setup as powerline_setup
"python powerline_setup()
" python del powerline_setup
set laststatus=2
set t_Co=256
" Notepad ++
inoremap <leader>d <esc>yypi
nnoremap <leader>d yyp
vnoremap <leader>d 0y0p
" Folding
" autocmd FileType javascript set foldmethod=indent
" Escape in Insert and Visual modes
inoremap <leader><leader> <esc>
vnoremap <leader><leader> <esc>
" END MÀJ !
" "REQUIRED for latexsuite
" filetype plugin on
"
" "IMPORTANT
set grepprg=grep\.-nH\ $*
imap <buffer> <leader>it <Plug>Tex_InsertItemOnThisLine
"
"
"Latex
" "OPTIONNEL
"filetype indent on
"let g:tex_flavor='latex'
" REPLIS: vim-latex replis automatiquement certaines sections et environnements
" ou commandes. La liste de ce qui doit être replié est géré par les varibales
" globales suivantes. Les replis se font en partant de la fin de la liste puis
" en remontant. Les defaut sont dans folding.vim (~/.vim/ftplugin/latex-suite/)
"let g:Tex_FoldedSections="part,chapter,section,%%fakesection,subsection"
"let g:Tex_FoldedEnvironments="verbatim,comment,eq,figure,table,tabular,tikzpicture,thebibliography,abstract,frame"
"let g:Tex_FoldedMisc = 'preamble,<<<' " >>>
" COMPILATION VISUALISATION: par defaut on compile avec pdflatex et on utilise
" pour visualiser les pdf : kpdf
"let g:Tex_DefaultTargetFormat="pdf"
"let g:Tex_ViewRule_pdf = "qpdfview"