30.01.2014 г.

Debian vi - > vim, конфигурационнен файл:

Debian vi - > vim, конфигурационнен файл:
apt-get install vim
nano ~/.bashrc - > alias vi = "vim"
vi /etc/vi/vimrc

" Use Vim settings
set nocompatible

fixdel
syntax enable

set ruler           " displays the 'ruler' at the bottom-right of the screen
set number          " precede each line with its line number.
set nowrap          " no line wrapping;
set guioptions+=b   " add a horizontal scrollbar to the bottom

"colorscheme zenburn

"--- search options ------------
set incsearch       " show 'best match so far' as you type
set hlsearch        " hilight the items found by the search
set ignorecase      " ignores case of letters on searches
set smartcase       " Override the 'ignorecase' option if the search pattern contains upper case characters
:highlight search guifg=yellow guibg=darkred

"--- indentation ---------------
set expandtab
set smarttab
set smartindent    " smart indent of code - indent after opening '{',

"set autoindent     " Copy indent from current line when starting a new line
set shiftwidth=4   " Number of spaces to use for each step of (auto)indent (used for the >>, << commands)
set tabstop=4      " Number of spaces that a <Tab> in the file counts for.
set softtabstop=4  " Backspace the proper number of spaces
set shiftround     " Round indent to multiple of 'shiftwidth'

" comments are not placed in the first column.  They stay at their current indent level
inoremap # #

"--- Keystrokes ----------------
" h and l wrap between lines, cursor keys wrap in insertion mode
set whichwrap=h,l,~,[,]

" page down with <SPACE>, pageup with - or <BkSpc>
noremap <Space> <PageDown>
noremap <BS> <PageUp>

" allow <BkSpc> to delete line breaks, start of insertion, and indents
set backspace=eol,start,indent

"--- windowing -----------------
" be able to scroll through opened files easily with ctrl+j/k
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
set wmh=0   "set other opened files to just show filename


" have command-line completion <Tab> (for filenames, help topics, option names)
" first list the available options and complete the longest common part, then
" have further <Tab>s cycle through the possibilities:
set wildmode=list:longest,full

"--- python formatting help ---
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class

"-- always set cwd to current buffer ---
" * helps a lot with multiple windows
function! CHANGE_CURR_DIR()
let _dir = expand("%:p:h")
exec "cd " . _dir
unlet _dir
endfunction

autocmd BufEnter * call CHANGE_CURR_DIR()

Няма коментари :

Публикуване на коментар