1
0
Fork 0
mirror of synced 2024-06-01 06:51:09 -04:00

better tabs

This commit is contained in:
Mirosław Pragłowski 2015-02-13 23:52:00 +01:00
parent 2538b10b99
commit 84a0374b6d

View file

@ -1,12 +1,12 @@
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer: " Maintainer:
" Amir Salihefendic " Amir Salihefendic
" http://amix.dk - amix@amix.dk " http://amix.dk - amix@amix.dk
" "
" Version: " Version:
" 5.0 - 29/05/12 15:43:36 " 5.0 - 29/05/12 15:43:36
" "
" Blog_post: " Blog_post:
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github " http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github
" "
" Awesome_version: " Awesome_version:
@ -19,7 +19,7 @@
" Syntax_highlighted: " Syntax_highlighted:
" http://amix.dk/vim/vimrc.html " http://amix.dk/vim/vimrc.html
" "
" Raw_version: " Raw_version:
" http://amix.dk/vim/vimrc.txt " http://amix.dk/vim/vimrc.txt
" "
" Sections: " Sections:
@ -61,7 +61,7 @@ let g:mapleader = ","
" Fast saving " Fast saving
nmap <leader>w :w!<cr> nmap <leader>w :w!<cr>
" :W sudo saves the file " :W sudo saves the file
" (useful for handling the permission-denied error) " (useful for handling the permission-denied error)
command W w !sudo tee % > /dev/null command W w !sudo tee % > /dev/null
@ -73,7 +73,7 @@ command W w !sudo tee % > /dev/null
set so=7 set so=7
" Avoid garbled characters in Chinese language windows OS " Avoid garbled characters in Chinese language windows OS
let $LANG='en' let $LANG='en'
set langmenu=en set langmenu=en
source $VIMRUNTIME/delmenu.vim source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim source $VIMRUNTIME/menu.vim
@ -105,23 +105,23 @@ set whichwrap+=<,>,h,l
" Ignore case when searching " Ignore case when searching
set ignorecase set ignorecase
" When searching try to be smart about cases " When searching try to be smart about cases
set smartcase set smartcase
" Highlight search results " Highlight search results
set hlsearch set hlsearch
" Makes search act like search in modern browsers " Makes search act like search in modern browsers
set incsearch set incsearch
" Don't redraw while executing macros (good performance config) " Don't redraw while executing macros (good performance config)
set lazyredraw set lazyredraw
" For regular expressions turn magic on " For regular expressions turn magic on
set magic set magic
" Show matching brackets when text indicator is over them " Show matching brackets when text indicator is over them
set showmatch set showmatch
" How many tenths of a second to blink when matching brackets " How many tenths of a second to blink when matching brackets
set mat=2 set mat=2
@ -139,7 +139,7 @@ set foldcolumn=1
" => Colors and Fonts " => Colors and Fonts
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable syntax highlighting " Enable syntax highlighting
syntax enable syntax enable
try try
colorscheme desert colorscheme desert
@ -182,8 +182,9 @@ set expandtab
set smarttab set smarttab
" 1 tab == 2 spaces " 1 tab == 2 spaces
set shiftwidth=2
set tabstop=2 set tabstop=2
set shiftwidth=2
set softtabstop=2
" Linebreak on 500 characters " Linebreak on 500 characters
set lbr set lbr
@ -233,8 +234,8 @@ map <leader>ba :1,1000 bd!<cr>
map <leader>tn :tabnew<cr> map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr> map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr> map <leader>tc :tabclose<cr>
map <leader>tm :tabmove map <leader>tm :tabmove
map <leader>t<leader> :tabnext map <leader>t<leader> :tabnext
" Let 'tl' toggle between this and the last accessed tab " Let 'tl' toggle between this and the last accessed tab
let g:lasttab = 1 let g:lasttab = 1
@ -249,7 +250,7 @@ map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
" Switch CWD to the directory of the open buffer " Switch CWD to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr> map <leader>cd :cd %:p:h<cr>:pwd<cr>
" Specify the behavior when switching between buffers " Specify the behavior when switching between buffers
try try
set switchbuf=useopen,usetab,newtab set switchbuf=useopen,usetab,newtab
set stal=2 set stal=2
@ -312,7 +313,7 @@ autocmd BufWrite *.coffee :call DeleteTrailingWS()
vnoremap <silent> gv :call VisualSelection('gv', '')<CR> vnoremap <silent> gv :call VisualSelection('gv', '')<CR>
" Open Ack and put the cursor in the right position " Open Ack and put the cursor in the right position
map <leader>g :Ack map <leader>g :Ack
" When you press <leader>r you can search and replace the selected text " When you press <leader>r you can search and replace the selected text
vnoremap <silent> <leader>r :call VisualSelection('replace', '')<CR> vnoremap <silent> <leader>r :call VisualSelection('replace', '')<CR>
@ -372,7 +373,7 @@ function! CmdLine(str)
exe "menu Foo.Bar :" . a:str exe "menu Foo.Bar :" . a:str
emenu Foo.Bar emenu Foo.Bar
unmenu Foo unmenu Foo
endfunction endfunction
function! VisualSelection(direction, extra_filter) range function! VisualSelection(direction, extra_filter) range
let l:saved_reg = @" let l:saved_reg = @"