Default to 8-char tabs in C/C++ files, changed colour scheme, enabled numbers, visual mode mouse selection support, improved general completion behaviour and set some sane defaults for gvim

This commit is contained in:
fedora 2019-05-15 03:29:22 +02:00
parent 158cf82261
commit f097c74c32
Signed by: wanderer
GPG Key ID: 7B28D8DC28BD2388

69
vimrc

@ -1,7 +1,5 @@
set nocompatible
filetype off "required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@ -33,8 +31,6 @@ filetype plugin on " required
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
""""""""""""""""""""""""""""""""""""
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
@ -68,11 +64,11 @@ endfunction
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" Close popup by <Space>.
" Close popup by <Space>. NO, this makes it slow af to type
"inoremap <expr><Space> pumvisible() ? "\<C-y>" : "\<Space>"
" AutoComplPop like behavior.
"let g:neocomplete#enable_auto_select = 1
let g:neocomplete#enable_auto_select = 0
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
@ -87,10 +83,10 @@ if !exists('g:neocomplete#sources#omni#input_patterns')
endif
""""""""""""""""""""""""""""""""""""
set softtabstop=2
set tabstop=2
set shiftwidth=2
" Linux kernel style tabs
set softtabstop=8
set tabstop=8
set shiftwidth=8
set expandtab
set smarttab
@ -99,9 +95,7 @@ set errorformat+=%.%#PHP:\ %m\ \(in\ %f\ on\ line\ %l\)%.%#,
autocmd BufNewFile,BufRead svn-commit.*tmp :0r $SVN_COMMIT_TEMPLATE
set nocompatible
set tags=tags;/
set incsearch " incrimental search
@ -109,51 +103,72 @@ set hlsearch " highlighting when searching
filetype indent plugin off
set autoindent
set backspace=2
set nolist " show/hide tabs and EOL chars
set nonumber " show/hide line numbers (nu/nonu)
set scrolloff=5 " scroll offsett, min lines above/below cursor
set nolist " show/hide tabs and EOL chars (hidden characters)
set number " show/hide line numbers (nu/nonu)
set scrolloff=5 " scroll offset, min lines above/below cursor
"set scrolljump=5 " jump 5 lines when running out of the screen - NO
set sidescroll=10 " minumum columns to scroll horizontally
set sidescroll=10 " minimum columns to scroll horizontally
set showcmd " show command status
set showmatch " flashes matching paren when one is typed
set showmatch " flashes matching parenthese when cursor over the other one
set showmode " show editing mode in status (-- INSERT --)
set ruler " show cursor position
set nofen
set foldmethod=indent " indent based folding
set errorbells " no bells in terminal
set errorbells " bells in terminal
set undolevels=1000 " number of undos stored
set viminfo='50,"50 " '=marks for x files, "=registers for x files
au BufNewFile,BufRead *.py,*.pyw,*.c,*.h,*.pyx,%akefil*
au FileType c setl ofu=ccomplete#CompleteCpp
au BufNewFile,BufRead *.py,*.pyw,*.pyx,?akefil*
\ setlocal tabstop=4 shiftwidth=4 softtabstop=4 noexpandtab autoindent
\ textwidth=79 fileformat=unix
au BufNewFile,BufRead *.c,*.h,*.cpp
\ setlocal tabstop=8 shiftwidth=8 softtabstop=8 noexpandtab autoindent
\ textwidth=79 fileformat=unix
set encoding=utf-8 " important for powerline besides others
set scs " override 'ignorecase' when pattern has upper case characters
:vmap gb :<C-U>!git blame % -L<C-R>=line("'<") <CR>,<C-R>=line("'>") <CR><CR>
:nmap gb :!git blame %<CR>
:colo pablo " new fav highlighting
:set mouse=a " enable mouse in n,v,i,c,h modes
if &t_Co > 2 || has("gui_running")
":set cursorline " Enable cursor line position tracking
":highlight clear CursorLine " Remove the underline from enabling cursorline
":highlight CursorLineNR ctermbg=darkgrey " Set line numbering to red background
" gvim bits
if (&t_Co > 2 || has("gui_running"))
"if has("gui_running")
if has("gui_gtk2")
:set guifont=Source\ Code\ Pro\ 11
:syntax on
:set background=dark
:colo evening
elseif has("gui_gtk3")
:set guifont=Source\ Code\ Pro\ 11
:set background=dark
:syntax on
:colo evening
endif
" Change the highlight color for Comment and Special
" to Cyan. Blue is too dark for a black background.
"
:highlight Comment term=bold ctermfg=cyan guifg=cyan
:highlight Special term=bold ctermfg=cyan guifg=cyan
:highlight Constant term=bold ctermfg=red guifg=cyan
":highlight Comment term=bold ctermfg=cyan guifg=cyan
":highlight Special term=bold ctermfg=cyan guifg=cyan
":highlight Constant term=bold ctermfg=red guifg=cyan
endif
:colo delek " new fav highlighting
:set laststatus=2 " show powerline status bar
set t_Co=256
let g:Powerline_symbols = "fancy" " sth like this probably set as a default but won't hurt here