Welcome, Guest. Please login or register.
+  Linux Soft Forum
|-+  Īnvaţă» Tips&Tricks» $HOME/.vimrc
[Picture 161] [Picture 160] [Picture 159]
Username:
Password:
 
Pages: 1 [2]   Go Down
  Print  
Author Topic: $HOME/.vimrc  (Read 5463 times)
0 Members and 1 Guest are viewing this topic.
~Empathy~
Veteran
**

Decadence is Bliss...


« Reply #15 on: December 07, 2008, 09:20:14 PM »

Welcome Smiley. E super crosshair in vim-ul grafic Smiley.
Logged

~Empathy~
Veteran
**

Decadence is Bliss...


« Reply #16 on: December 09, 2008, 09:41:15 PM »

L-am adus la perfectiune.

" .vimrc
"
" Smart features:
"     o use TAB to for omni-completion. Knows when to do completion and when
"       to insert a real TAB. In C/C++ it does auto-completion from (exuberant)
"       ctags files.
"     o use CTRL-Space to do auto-completion based on words in current
"       buffers.
"     o you can scroll one screen at a time with Space and CTRL-B in Normal
"       mode, like you would do in a pager when viewing man pages.
"     o in Normal mode, ; is mapped to : so that you don't have to press shift
"       for every command.
"     o When you insert items that come in pairs (like " " or ()), vim
"       automatically places the matched item and it does it in a smart way, so
"       if you type it again, it would not insert the item twice.
"
" Requires:
"     o exuberant tags for omni-completion (1).
"     o OmniCppComplete plugin for C++ omni-completion (2).
"     o AutoClose plugin (3)
"     o SuperTab plugin (4)
"     o oceandeep colorscheme (5)
"
" 1) http://ctags.sourceforge.net/
" 2) http://www.vim.org/scripts/script.php?script_id=1520
" 3) http://www.vim.org/scripts/script.php?script_id=2009
" 4) http://www.vim.org/scripts/script.php?script_id=182
" 5) http://www.vim.org/scripts/script.php?script_id=368
 
 
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
 
" -----------------
" display settings
" -----------------
 
" don't highlight matched parens
let loaded_matchparen=1
 
set nowrap
set scrolloff=2
set number              " show line numbers
set showmode            " show mode in status bar
set showcmd             " display incomplete commands
set title
set ruler               " show the cursor position all the time
set laststatus=2        " use 2 lines for the status bar
set wildmenu            " completion with menu
set wildmode=list:longest,full
set bs=indent,eol,start " allow backspacing over everything in insert mode
 
" don't show :intro message when starting vim
set shortmess=fiIlnxtToO
 
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
        syntax on
        set hlsearch
endif
 
" the GUI version gets more coloured options then the CLI version
if has("gui_running")
        colorscheme oceandeep
        set background=dark
       
        " disable menus and toolbars in GUI mode
        " unfortunately this doesn't work with MacVim
        set guioptions=-m
        set guioptions=-T
 
        " fit 2 80 column windows
        set lines=51
        set columns=172
       
        " crosshair cursor
        set cursorline
        set cursorcolumn
else
        colorscheme delek
        set background=dark
endif
 
" ------------
" keybindings
" ------------
 
" in normal mode, : is used in most of the commands, so we swap ; and :
" conviniently
nnoremap ; :
nnoremap : ;
 
" scroll the screen with Space in normal mode, like you would normaly do with
" a pager like less or more. This is consistent with man(1) behaviour.
nmap <Space> <C-F>
 
" CTRL-U in insert mode deletes a lot.  Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>
 
" Note: with SuperTab plugin you can autocomplete (omni-completion <C-X><C-O>)
" with <Tab>
 
" <CR> will simply select the highlighted menu item just as C-Y does
inoremap <expr> <CR> pumvisible() ? "\<c-y>" : "\<c-g>u\<CR>"
" When the autocomplete menu is up, make C-N simulate the "Down" key
inoremap <expr> <C-N> pumvisible() ? "\<lt>c-n>" : "\<lt>c-n>\<lt>c-r>=pumvisible() ? \"\\<lt>down>\" : \"\"\<lt>cr>"
" Make C-Space bring up the <C-N> completion menu, then simulate C-N C-P to
" remove the longest common text, and finally simlates the "Down" key to keep
" a matched highlight
inoremap <expr> <C-@> pumvisible() ? "\<lt>c-n>" : "\<lt>c-x>\<lt>c-n>\<lt>c-n>\<lt>c-p>\<lt>c-r>=pumvisible() ? \"\\<lt>down>\" : \"\"\<lt>cr>"
 
" ----------------
" editor settings
" ----------------
 
set incsearch           " do incremental searching
set ignorecase          " ignore case in searches...
set smartcase           " ...unless they contain upper case letters
set gdefault            " assume the g flag to :s substitutions
set magic               " change the way backslashes are used in search pattern
 
" file type specific settings
if has("autocmd")
 
        " Enable file type detection.
        " Use the default filetype settings, so that mail gets 'tw' set to 72,
        " 'cindent' is on in C files, etc.
        " Also load indent files, to automatically do
        " language-dependent indenting.
        filetype plugin indent on
 
        " Put these in an autocmd group, so that we can delete them easily.
        augroup vimrcEx
                au!
 
                " For all text files set 'textwidth' to 78 characters.
                autocmd FileType text setlocal textwidth=78
 
                " When editing a file, always jump to the last known cursor
                " position. Don't do it when the position is invalid or when
                " inside an event handler (happens when dropping a file
                " on gvim). Also don't do it when the mark is in the first
                " line, that is the default position when opening a file.
                autocmd BufReadPost *
                \ if line("'\"") > 1 && line("'\"") <= line("$") |
                \     exe "normal! g`\"" |
                \ endif
 
        augroup END
else
        set autoindent  " always set autoindenting on
        set smartindent " and do it smart
endif " has("autocmd")
 
" ---------------------
" programming settings
" ---------------------
 
set tags +=~/.tags/include
set tags +=~/.tags/include.sys
set tags +=~/.tags/include.c++
set tags +=~/.vim/src/stl/tags
 
set completeopt=longest,menuone
if has("autocmd") && exists("+omnifunc")
        autocmd Filetype *
                \   if &omnifunc == "" |
                \           setlocal omnifunc=syntaxcomplete#Complete |
                \   endif
endif
 
let OmniCpp_ShowPrototypeInAbbr = 1
 
" --------------
" misc settings
" --------------
 
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
        set mouse=a
endif
 
set nomodeline
set history=1024        " keep 1024 lines of command line history
" Suffixes that get lower priority when doing tab completion for filenames.
set suffixes=.bak,~,.swp,.o,.obj,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out.toc,.class
 
if has("vms")
        set nobackup    " do not keep a backup file, use versions instead
else
        set backup      " keep a backup file
endif
 
" don't cludder the work directories with ~backup files
set backupdir=~/.vim/backup
 
" ----------
" functions
" ----------
 
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
        command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
            \ | wincmd p | diffthis
endif


Screenshot-ul e cam irelevant...
Logged

Pages: 1 [2]   Go Up
  Print  
 
Jump to: