.vimrc
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 01 Jan 2024 20:53:49 +0200
changeset 1039 78cdb4a057e3
parent 925 8a010eb167ff
permissions -rw-r--r--
Create symlink from ~/.bash_profile for login shell to activate my ~/.bashrc.

" On loding VIM search for /etc/vimrc, ~/.vimrc.

" Do not emulate old vi bug.
" This must be first, because it changes other options as side effect.
set nocompatible

" Switch syntax highlighting on, when the terminal has colors
if &t_Co > 2 || has("gui_running")
  syntax on
endif

" A 256 color scheme.
if &t_Co >= 256 || has("gui_running")
  colorscheme delek
endif

set sessionoptions=curdir,buffers,tabpages

" Show mode in last line of screen.
set showmode
" Show last command in last line of screen.
set showcmd
" Do not show line numbers.
set nonu
" Set command string height.
set ch=1

" Highlight line with cursor.
set cursorline
" Show long lines...
set colorcolumn=120

" Hide buffers instead of closing them.
set hidden

if has('mouse')
  set mouse=a
  set mousemodel=popup
  set mousehide
endif

" Number of lines of history to remember
set history=1000
" Number of levels of undo history
set undolevels=1000

" Same as set ts=4, by default - 8, how long TAB.
set tabstop=4
" Use spaces instead TAB.
set expandtab
set shiftwidth=4
set softtabstop=4
set smarttab
set et

" Move cursor on RET to previous line indent.
set autoindent
" Indent for C-like languages.
set smartindent

" This setting will cause the cursor to very briefly jump to a
" brace/parenthese/bracket's "match" whenever you type a closing or opening
" brace/parenthese/bracket. I've had almost no mismatched-punctuation errors
" since I started using this setting.
set showmatch

" Turn on incremental search with ignore case (except explicit caps).
set incsearch
set ignorecase
set smartcase
set hlsearch

" Substitude all matches in line.
set gdefault
nnoremap / /\v
vnoremap / /\v

" Beep instead of blink.
set novisualbell
set noerrorbells

" Have 3 lines of offset (or buffer) when scrolling.
set scrolloff=3
" set scrolljump=3

" I find the toolbar in the GUI version of vim (gvim) to be somewhat useless
" visual clutter. This option gets rid of the toolbar.
set guioptions-=T

" Statusline displays the current cursor position.
set ruler
" Always show statusline.
set laststatus=2

" By default, search matches are highlighted. I find this annoying most of the
" time. This option turns off search highlighting. You can always turn it back
" on with :set hls.
set nohls

" When you type the first tab hit will complete as much as possible, the
" second tab hit will provide a list, the third and subsequent tabs will cycle
" through completion options so you can complete the file without further
" keys.
set wildmode=longest,list,full
set wildmenu

set complete=""
" From current buffer.
set complete+=.
" From dictionary.
set complete+=k
" From another buffers.
set complete+=b
" From tags.
set complete+=t

" Disable these characters as word dividers.
set iskeyword+=_

" Allow backspacing over autoindent, line breaks (join lines), start of insert
set backspace=indent,eol,start

" Affects the output of :TOhtml.
:let html_use_css = 1
:let use_xhtml = 1

filetype plugin on

au FileType python setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4

" Fix <Enter> for comment
" set fo+=cr

" set termencoding=cp866
" set fileencoding=cp1251
" set fileencodings=cp1251,cp866,utf8
" set encoding=cp1251

" Local Variables:
" mode: fundamental
" comment-start: "\""
" eval: (font-lock-add-keywords nil '( ("^[[:blank:]]*\".*" . font-lock-comment-face) ))
" End: