mirror of
https://github.com/akelge/zsh
synced 2025-07-03 21:19:06 +00:00
Moved statusline def into a separate file
Added guitablabel def Updated VCS plugin Added keymap for choosing tabs (Cmd-1, Cmd-2, ...)
This commit is contained in:
131
vim/vimrc
131
vim/vimrc
@ -11,7 +11,7 @@ set viminfo='20,\"50,f10
|
||||
set history=50
|
||||
set nohlsearch
|
||||
set nostartofline
|
||||
"set paste
|
||||
" set paste
|
||||
|
||||
set ruler
|
||||
set cmdheight=1
|
||||
@ -24,6 +24,18 @@ set expandtab
|
||||
set softtabstop=4
|
||||
set autoindent
|
||||
set smartindent
|
||||
" For highlighted numbers:
|
||||
let python_highlight_numbers = 1
|
||||
"
|
||||
" For highlighted builtin functions:
|
||||
let python_highlight_builtins = 1
|
||||
"
|
||||
" For highlighted standard exceptions:
|
||||
let python_highlight_exceptions = 1
|
||||
"
|
||||
" Highlight erroneous whitespace:
|
||||
let python_highlight_space_errors = 1
|
||||
|
||||
" End Python settings
|
||||
|
||||
set nofoldenable
|
||||
@ -38,18 +50,20 @@ set encoding=utf-8
|
||||
set listchars=tab:->,trail:.,eol:$
|
||||
set smartcase
|
||||
set errorbells
|
||||
"set visualbell
|
||||
" set visualbell
|
||||
set showcmd " Show (partial) command in status line.
|
||||
set showmatch " Show matching brackets.
|
||||
set ignorecase " Do case insensitive matching
|
||||
set incsearch " Incremental search
|
||||
set autowrite " Automatically save before commands like :next and :make
|
||||
"set statusline=%<%f\ %H%m%r%=%-14.(%l,%c%)\ %P\ Buf.%n
|
||||
" set statusline=%<%f\ %H%m%r%=%-14.(%l,%c%)\ %P\ Buf.%n
|
||||
set showtabline=0
|
||||
set backupcopy=yes
|
||||
set fileformats=unix,mac,dos
|
||||
set fileformat=unix
|
||||
set mouse=a
|
||||
colorscheme inkpot
|
||||
set printfont=Monaco:h14
|
||||
colorscheme wombat256
|
||||
|
||||
" """""""""
|
||||
" User Info
|
||||
@ -134,6 +148,22 @@ nnoremap <silent> <S-Up> V
|
||||
vnoremap <silent> <S-Down> j
|
||||
vnoremap <silent> <S-Up> k
|
||||
|
||||
" Terminal/Filemanager integration
|
||||
nnoremap <silent> <F9> :OpenTerminal<CR>
|
||||
nnoremap <silent> <F10> :OpenFilemanager<CR><CR>
|
||||
|
||||
" Tab selection by number
|
||||
nnoremap <silent> <D-1> 1gt
|
||||
nnoremap <silent> <D-2> 2gt
|
||||
nnoremap <silent> <D-3> 3gt
|
||||
nnoremap <silent> <D-4> 4gt
|
||||
nnoremap <silent> <D-5> 5gt
|
||||
nnoremap <silent> <D-6> 6gt
|
||||
nnoremap <silent> <D-7> 7gt
|
||||
nnoremap <silent> <D-8> 8gt
|
||||
nnoremap <silent> <D-9> 9gt
|
||||
nnoremap <silent> <D-0> 10gt
|
||||
|
||||
" Vim5 comes with syntaxhighlighting. If you want to enable syntaxhightlighting
|
||||
" by default uncomment the next three lines.
|
||||
if has("syntax")
|
||||
@ -152,100 +182,9 @@ if has("autocmd")
|
||||
au BufNewFile,BufRead *.mako setf mako
|
||||
endif
|
||||
|
||||
|
||||
"recalculate the trailing whitespace warning when idle, and after saving
|
||||
autocmd cursorhold,bufwritepost * unlet! b:statusline_trailing_space_warning
|
||||
|
||||
"return '[\s]' if trailing white space is detected
|
||||
"return '' otherwise
|
||||
function! StatuslineTrailingSpaceWarning()
|
||||
if !exists("b:statusline_trailing_space_warning")
|
||||
if search('\s\+$', 'nw') != 0
|
||||
let b:statusline_trailing_space_warning = '[\s]'
|
||||
else
|
||||
let b:statusline_trailing_space_warning = ''
|
||||
endif
|
||||
endif
|
||||
return b:statusline_trailing_space_warning
|
||||
endfunction
|
||||
|
||||
|
||||
" """"""""""""
|
||||
" Status Line
|
||||
" """"""""""""
|
||||
|
||||
" Some useful functions
|
||||
"return the syntax highlight group under the cursor ''
|
||||
function! StatuslineCurrentHighlight()
|
||||
let name = synIDattr(synID(line('.'),col('.'),1),'name')
|
||||
if name == ''
|
||||
return ''
|
||||
else
|
||||
return '[' . name . ']'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"recalculate the tab warning flag when idle and after writing
|
||||
autocmd cursorhold,bufwritepost * unlet! b:statusline_tab_warning
|
||||
|
||||
"return '[&et]' if &et is set wrong
|
||||
"return '[mixed-indenting]' if spaces and tabs are used to indent
|
||||
"return an empty string if everything is fine
|
||||
function! StatuslineTabWarning()
|
||||
if !exists("b:statusline_tab_warning")
|
||||
let tabs = search('^\t', 'nw') != 0
|
||||
let spaces = search('^ ', 'nw') != 0
|
||||
|
||||
if tabs && spaces
|
||||
let b:statusline_tab_warning = '[mixed-indenting]'
|
||||
elseif (spaces && !&et) || (tabs && &et)
|
||||
let b:statusline_tab_warning = '[&et]'
|
||||
else
|
||||
let b:statusline_tab_warning = ''
|
||||
endif
|
||||
endif
|
||||
return b:statusline_tab_warning
|
||||
endfunction
|
||||
|
||||
" Real Status line definition
|
||||
set statusline=%t\ "tail of the filename
|
||||
|
||||
"display a warning if fileformat isnt unix
|
||||
set statusline+=%#warningmsg#
|
||||
set statusline+=%{&ff!='unix'?'['.&ff.']':''}
|
||||
set statusline+=%*
|
||||
|
||||
"display a warning if file encoding isnt utf-8
|
||||
set statusline+=%#warningmsg#
|
||||
set statusline+=%{(&fenc!='utf-8'&&&fenc!='')?'['.&fenc.']':''}
|
||||
set statusline+=%*
|
||||
|
||||
set statusline+=%h "help file flag
|
||||
set statusline+=%y "filetype
|
||||
set statusline+=%r "read only flag
|
||||
set statusline+=%m "modified flag
|
||||
|
||||
"display a warning if &et is wrong, or we have mixed-indenting
|
||||
set statusline+=%#error#
|
||||
set statusline+=%{StatuslineTabWarning()}
|
||||
set statusline+=%*
|
||||
|
||||
set statusline+=%{StatuslineTrailingSpaceWarning()}
|
||||
|
||||
"display a warning if &paste is set
|
||||
set statusline+=%#error#
|
||||
set statusline+=%{&paste?'[paste]':'[nopaste]'}
|
||||
set statusline+=%*
|
||||
|
||||
set statusline+=%= "left/right separator
|
||||
set statusline+=%{StatuslineCurrentHighlight()}\ \ "current highlight
|
||||
set statusline+=%02c, "cursor column
|
||||
set statusline+=%03l/%03L "cursor line/total lines
|
||||
set statusline+=\ hex:\ 0x%02B
|
||||
set statusline+=\ %P "percent through file
|
||||
|
||||
" User customizations are held in file ~/.vim/vimrc.local
|
||||
if filereadable($HOME."/.vim/vimrc.local")
|
||||
source $HOME/.vim/vimrc.local
|
||||
endif
|
||||
|
||||
" vim: set ts=4 sw=4 tw=0 ft=vim :
|
||||
|
Reference in New Issue
Block a user