-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
74 lines (53 loc) · 2.29 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
colorscheme jellybeans
set t_Co=256
:syntax on "Turn on syntax highlighting
:set laststatus=2 "Always show status line
:set autowrite "Automatically write a file when leaving a modified buffer
:set confirm "Start a dialog when a command fails (here when quit command fails)
:set tabstop=4 "Number of spaces a TAB in the text stands for
:set shiftwidth=4 "Number of spaces used for each step of (auto)indent
:set hlsearch "Have vim highlight the target of a search
:set incsearch "Do incremental searching
:set ruler "Show the cursor position all the time
:set number "Show line numbers
:set ignorecase "Ignore case when searching
":set pastetoggle=<F3> "Auto ident off when in paste-mode
nmap <F3> :set paste<CR>:r !pbpaste<CR>:set nopaste<CR>
imap <F3> <Esc>:set paste<CR>:r !pbpaste<CR>:set nopaste<CR>
nmap <F4> :.w !pbcopy<CR><CR>
vmap <F4> :w !pbcopy<CR><CR>
:set mouse=a "Mouse activated
:set clipboard=unnamed "Copy and Paste from clipboard
:set title "Show info in the window title
:set titlestring=PANKAJ:\ %F
"Automatically set screen title
"Indent only if the file is of type cpp,c,java,sh,pl,php,asp
:au FileType cpp,c,java,sh,pl,php,asp set autoindent
:au FileType cpp,c,java,sh,pl,php,asp set smartindent
:au FileType cpp,c,java,sh,pl,php,asp set cindent
"Wrapping long lines
:set wrapmargin=4 "Margin from the right in which to break a line. Set
" :set textwidth=70 "Line length above which to break a line
"Defining abbreviations
:ab #d #define
:ab #i #include
"Defining mine abbreviations
:ab #p printf("%");
"Defining abbreviations to draw comments
:ab #b /********************************
:ab #e ********************************/
:ab #l /*-------------------- --------------------*/
" Converting tabs to spaces
:au FileType cpp,c,java,sh,pl,php,asp,fl,html set expandtab "Converting tabs to spaces
call pathogen#infect()
""NERD TREE
" Give a shortcut key to NERD Tree
map <F2> :NERDTreeToggle<CR>
"Show hidden files in NerdTree
let NERDTreeShowHidden=1
"autopen NERDTree and focus cursor in new document
"autocmd VimEnter * NERDTree
"autocmd VimEnter * wincmd p
"" FILETYPE
au BufNewFile,BufRead *.fl set ft=cpp
au BufNewFile,BufRead *.cshtml set ft=html