diff options
-rw-r--r-- | vim.dot.link/filetype.vim | 7 | ||||
-rw-r--r-- | vimrc.dot.link | 72 |
2 files changed, 45 insertions, 34 deletions
diff --git a/vim.dot.link/filetype.vim b/vim.dot.link/filetype.vim index fb73703..6679641 100644 --- a/vim.dot.link/filetype.vim +++ b/vim.dot.link/filetype.vim @@ -37,6 +37,13 @@ augroup puppet autocmd BufRead,BufNewFile *.pp setfiletype puppet augroup END +" PHP +augroup php + autocmd! + autocmd BufRead,BufNewFile *.php setfiletype php + autocmd FileType php let php_sql_query=1 +augroup END + " Drupal *.module and *.install files. if has("autocmd") augroup module diff --git a/vimrc.dot.link b/vimrc.dot.link index 5c5a1fd..b179acc 100644 --- a/vimrc.dot.link +++ b/vimrc.dot.link @@ -21,13 +21,18 @@ set ignorecase set smartcase let mapleader="-" -" Syntax highlight +" Syntax highlighting syntax on " Indenting filetype indent off filetype plugin indent on +" Syntax check +let g:syntastic_mode_map={ 'mode': 'passive', + \ 'active_filetypes': [], + \ 'passive_filetypes': [] } + " Folding " Disabled due to slowness "set foldmethod=syntax @@ -42,34 +47,20 @@ filetype plugin indent on "let vimsyn_folding='af' "let xml_syntax_folding=1 -" See http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file -"set autochdir -augroup changedir - autocmd! - autocmd BufEnter * silent! lcd %:p:h -augroup END - " Command mode completion " See https://stackoverflow.com/questions/526858/how-do-i-make-vim-do-normal-bash-like-tab-completion-for-file-names "set wildmode=longest,list set wildmode=longest,list,full set wildmenu -" PHP -let php_sql_query=1 - -" No modelines +" Disable modelines +" " https://lwn.net/Articles/20249/ " http://usevim.com/2012/03/28/modelines/ " http://www.techrepublic.com/blog/it-security/turn-off-modeline-support-in-vim/ set nomodeline set modelines=0 -" Syntax check -let g:syntastic_mode_map={ 'mode': 'passive', - \ 'active_filetypes': [], - \ 'passive_filetypes': [] } - " Color scheme "colorscheme github "colorscheme solarized @@ -86,6 +77,11 @@ else colorscheme zenburn endif +" Status and tab lines +set laststatus=2 " Always display the statusline in all windows +set showtabline=2 " Always display the tabline, even if there is only one tab +set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline) + " Airline if $WINDOWID != "" let g:airline_powerline_fonts=1 @@ -99,38 +95,46 @@ endif "python powerline_setup() "python del powerline_setup -set laststatus=2 " Always display the statusline in all windows -set showtabline=2 " Always display the tabline, even if there is only one tab -set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline) - -" See +" Autoread +" " http://vim.wikia.com/wiki/Have_Vim_check_automatically_if_the_file_has_changed_externally " http://stackoverflow.com/questions/2490227/how-does-vims-autoread-work " http://stackoverflow.com/questions/2490227/how-does-vims-autoread-work "au FocusGained,BufEnter * :silent! ! "au FocusLost,WinLeave * :silent! w -" Session management, see: +" Autosave +" See https://github.com/vim-scripts/vim-auto-save +"let g:auto_save = 1 + +" Auto change dir +" +" Automatically set the current working directory to the current buffer file's +" directory +" +" See http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file +"set autochdir +augroup changedir + autocmd! + autocmd BufEnter * silent! lcd %:p:h +augroup END + +" Session management +" " http://usevim.com/2013/07/05/sessions/ " https://github.com/xolox/vim-session " https://github.com/tpope/vim-obsession " http://stackoverflow.com/questions/1642611/how-to-save-a-session-in-vim " https://bocoup.com/weblog/sessions-the-vim-feature-you-probably-arent-using/ " http://vimdoc.sourceforge.net/htmldoc/usr_21.html#21.4 -"let g:session_autosave_periodic=1 -let g:session_autosave_silent=1 -let g:session_autosave='yes' -let g:session_autoload='no' -let g:session_directory='~/.local/share/vim/sessions' - -" Session options " https://github.com/xolox/vim-session?tab=readme-ov-file#options +"let g:session_autosave_periodic=1 set sessionoptions-=buffers set sessionoptions-=blank set sessionoptions-=resize set sessionoptions-=winsize set sessionoptions-=winpos - -" Autosave -" See https://github.com/vim-scripts/vim-auto-save -"let g:auto_save = 1 +let g:session_autosave_silent=1 +let g:session_autosave='yes' +let g:session_autoload='no' +let g:session_directory='~/.local/share/vim/sessions' |