Browse code

vimrc - v0.1 - Improve commenting and screen behavior

Fred authored on19/10/2014 18:02:19
Showing1 changed files
... ...
@@ -1,6 +1,7 @@
1 1
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2 2
 " Versions
3 3
 "
4
+" v0.1 - 2014-10-19: variable for screen integration set / commands for (un)commenting block added / no backup behavior
4 5
 " v0.0 - 2012-06-09: current vimrc fetch from the Internet
5 6
 " 
6 7
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
... ...
@@ -69,7 +70,11 @@ let mapleader = ","
69 70
 let g:mapleader = ","
70 71
 
71 72
 " Fast saving
72
-nmap <leader>w :w!<cr>
73
+"nmap <leader>w :w!<cr>
74
+
75
+" Set 256 colors
76
+set t_Co=256
77
+
73 78
 
74 79
 
75 80
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
... ...
@@ -156,7 +161,7 @@ set ffs=unix,dos,mac
156 161
 " => Files, backups and undo
157 162
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
158 163
 " Turn backup off, since most stuff is in SVN, git et.c anyway...
159
-"set nobackup
164
+set nobackup
160 165
 set nowb
161 166
 set noswapfile
162 167
 
... ...
@@ -331,6 +336,7 @@ map <leader>sa zg
331 336
 map <leader>s? z=
332 337
 
333 338
 
339
+
334 340
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
335 341
 " => Misc
336 342
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
... ...
@@ -343,6 +349,14 @@ map <leader>q :e ~/buffer<cr>
343 349
 " Toggle paste mode on and off
344 350
 map <leader>pp :setlocal paste!<cr>
345 351
 
352
+" Toggle hilight search on or or using F8 (source: http://www.developpez.net/forums/d8477/systemes/linux/applications/enlever-surbrillance-lors-recherche-vi/)
353
+nnoremap <f8> :set hlsearch!\|set hlsearch?<cr>
354
+
355
+" visually select block of text to comment (modified from http://vim.wikia.com/wiki/Commenting_out_a_range_of_lines)
356
+vmap <C-M>  :s/^/#/<CR>:noh<CR>
357
+
358
+" uncomment visually selected text, with Ctrl-N,N(modified from http://vim.wikia.com/wiki/Commenting_out_a_range_of_lines)
359
+vmap <C-N> :s/^#//<CR>:noh<CR>
346 360
 
347 361
 
348 362
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
... ...
@@ -404,5 +418,3 @@ function! <SID>BufcloseCloseIt()
404 418
      execute("bdelete! ".l:currentBufNum)
405 419
    endif
406 420
 endfunction
407
-
408
-