Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.52 KB | None | 0 0
  1. :colorscheme molokai " Set colorScheme
  2. :set number " Display line numbers on the left side
  3. :set ls=2 " This makes Vim show a status line even when only one window is shown
  4. :filetype plugin on " This line enables loading the plugin files for specific file types
  5. :set tabstop=4 " Set tabstop to tell vim how many columns a tab counts for. Linux kernel code expects each tab to be eight columns wide.
  6. :set expandtab " When expandtab is set, hitting Tab in insert mode will produce the appropriate number of spaces.
  7. :set softtabstop=4 " Set softtabstop to control how many columns vim uses when you hit Tab in insert mode. If softtabstop is less than tabstop and expandtab is not set, vim will use a combination of tabs and spaces to make up the desired spacing. If softtabstop equals tabstop and expandtab is not set, vim will always use tabs. When expandtab is set, vim will always use the appropriate number of spaces.
  8. :set shiftwidth=4 " Set shiftwidth to control how many columns text is indented with the reindent operations (<< and >>) and automatic C-style indentation.
  9. :setlocal foldmethod=indent " Set folding method
  10. :set t_Co=256 " makes Vim use 256 colors
  11. :set nowrap " Don't Wrap lines!
  12. :set clipboard=unnamed
  13. :set clipboard=unnamedplus
  14. :set autoindent " Automatic indentation
  15. :set cindent " This turns on C style indentation
  16. :set si " Smart indent
  17. :set encoding=utf-8 " Use UTF-8 encoding
  18. :syntax enable " syntax highlighting
  19. :set showmatch " Show matching brackets
  20. :set hlsearch " Highlight in search
  21. :set ignorecase " Ignore case in search
  22. :set noswapfile " Avoid swap files
  23. :set mouse=a " Mouse Integration
  24.  
  25.  
  26. " auto complete for ( , " , ' , [ , {
  27. :inoremap ( ()<Left>
  28. :inoremap " ""<Left>
  29. :inoremap ` ``<Left>
  30. :inoremap ' ''<Left>
  31. :inoremap [ []<Left>
  32. :inoremap { {}<Left>
  33.  
  34. " auto comment and uncooment with F6 and F7 key
  35. " :autocmd FileType c,cpp,java,scala, php let b:comment_leader = '// '
  36. " :autocmd FileType sh,ruby,python let b:comment_leader = '# '
  37. " :noremap <silent> #6 :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR> " commenting line with F6
  38. " :noremap <silent> #7 :<C-B>silent <C-E>s/^\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR> " uncommenting line with F7
  39.  
  40. "for xfce4-terminal
  41. " :noremap <silent> #5 :!xfce4-terminal --title "%" --hold -e "./%" <CR> <CR> " execute bash & python script with F5
  42.  
  43. "for mate-terminal
  44. ":noremap <silent> #5 :!mate-terminal --title "%" -e "./%" <CR> <CR>" execute bash & python script with F5
  45.  
  46. "for xterm terminal
  47. ":noremap <silent> #5 :!xterm -hold -e "./%" <CR> <CR>" execute bash & python script with F5
  48.  
  49. "for kde terminal(konsole)
  50. ":noremap <silent> #5 :!konsole --hold -e "./%" <CR> <CR>" execute bash & python script with F5
  51.  
  52.  
  53.  
  54. :noremap <silent> #3 :bp<CR> " switch to pervious tab with F3
  55. :noremap <silent> #4 :bn<CR> " switch to next tab with F4
  56. :map <F8> :setlocal spell! spelllang=en_us<CR> " check spelling with F8
  57. :set pastetoggle=<F2> " Paste mode toggle with F2 Pastemode disable auto-indent and bracket auto-compelation and it helps you to paste code fro elsewhere .
  58.  
  59. " ###########################################################
  60.  
  61. :set nocompatible
  62. filetype off
  63. :set rtp+=/home/sam/.vim/bundle/vundle/
  64. call vundle#rc()
  65.  
  66. Bundle 'gmarik/vundle'
  67.  
  68. filetype plugin indent on
  69.  
  70. augroup vimrc_autocmds
  71. autocmd!
  72. autocmd FileType python highlight Excess ctermbg=DarkGray guibg=Black
  73. autocmd FileType python match Excess /\%120v.*/
  74. autocmd FileType python set nowrap
  75. augroup END
  76.  
  77. " Airline
  78. Plugin 'vim-airline/vim-airline'
  79. Plugin 'vim-airline/vim-airline-themes'
  80.  
  81. let g:airline#extensions#tabline#enabled = 1
  82. let g:airline#extensions#tabline#left_sep = ' '
  83. let g:airline#extensions#tabline#left_alt_sep = '|'
  84. let g:airline_theme='simple'
  85.  
  86. " DevIocn
  87. Plugin 'ryanoasis/vim-devicons'
  88. set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types\ 11
  89. let g:airline_powerline_fonts=1
  90.  
  91. " WorkSpace
  92. Plugin 'bagrat/vim-workspace'
  93. let g:workspace_powerline_separators = 1
  94. let g:workspace_tab_icon = "\uf00a"
  95. let g:workspace_left_trunc_icon = "\uf0a8"
  96. let g:workspace_right_trunc_icon = "\uf0a9"
  97. noremap <Tab> :WSNext<CR>
  98. noremap <S-Tab> :WSPrev<CR>
  99. noremap <Leader><Tab> :WSClose<CR>
  100. noremap <Leader><S-Tab> :WSClose!<CR>
  101. noremap <C-t> :WSTabNew<CR>
  102.  
  103. cabbrev bonly WSBufOnly
  104.  
  105. " JavaScript template highlight
  106. Plugin 'Quramy/vim-js-pretty-template'
  107.  
  108. " YouCompleteMe
  109. Plugin 'Valloric/YouCompleteMe'
  110.  
  111. " TypeScript
  112. Plugin 'leafgarland/typescript-vim'
  113. let g:typescript_indent_disable = 1
  114.  
  115. " NerdCommenter
  116. Plugin 'scrooloose/nerdcommenter'
  117. " Add spaces after comment delimiters by default
  118. let g:NERDSpaceDelims = 1
  119.  
  120. " Use compact syntax for prettified multi-line comments
  121. let g:NERDCompactSexyComs = 1
  122.  
  123. " Align line-wise comment delimiters flush left instead of following code indentation
  124. let g:NERDDefaultAlign = 'left'
  125.  
  126. " Set a language to use its alternate delimiters by default
  127. let g:NERDAltDelims_java = 1
  128.  
  129. " Add your own custom formats or override the defaults
  130. let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }
  131.  
  132. " Allow commenting and inverting empty lines (useful when commenting a region)
  133. let g:NERDCommentEmptyLines = 1
  134.  
  135. " Enable trimming of trailing whitespace when uncommenting
  136. let g:NERDTrimTrailingWhitespace = 1
  137.  
  138.  
  139. " Statify
  140. Plugin 'mhinz/vim-startify'
  141.  
  142. " Power line
  143. " Bundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
  144. " set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
  145. " set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9
  146. " set laststatus=2
  147. " set t_Co=256
  148. " set g:powerline_pycmd = "py3
  149.  
  150. " Fugitive setup
  151. Bundle 'tpope/vim-fugitive'
  152.  
  153. " Tagbar
  154. Bundle 'majutsushi/tagbar'
  155. nmap <F5> :TagbarToggle<CR>
  156.  
  157. " NerdTree setup
  158. Bundle 'scrooloose/nerdtree'
  159. " map <F2> :NERDTreeToggle<CR>
  160.  
  161. " NERDTree plugin setting
  162. :map <F9> :NERDTreeToggle<CR> " toggle showing NERDTree
  163. "open a NERDTree automatically when vim starts up if no files were specified
  164. :autocmd StdinReadPre * let s:std_in=1
  165. :autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
  166. :autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif " close vim if the only window left open is a NERDTree
  167.  
  168. " Python mode setup
  169. Bundle 'klen/python-mode'
  170. " Python-mode
  171. " Activate rope
  172. " Keys:
  173. " K Show python docs
  174. " <Ctrl-Space> Rope autocomplete
  175. " <Ctrl-c>g Rope goto definition
  176. " <Ctrl-c>d Rope show documentation
  177. " <Ctrl-c>f Rope find occurrences
  178. " <Leader>b Set, unset breakpoint (g:pymode_breakpoint enabled)
  179. " [[ Jump on previous class or function (normal, visual, operator
  180. " modes)
  181. " ]] Jump on next class or function (normal, visual, operator
  182. " modes)
  183. " [M Jump on previous class or method (normal, visual, operator
  184. " modes)
  185. " ]M Jump on next class or method (normal, visual, operator
  186. " modes)
  187. let g:pymode_rope = 0
  188.  
  189. " Documentation
  190. let g:pymode_doc = 1
  191. let g:pymode_doc_key = 'K'
  192.  
  193. " Linting
  194. let g:pymode_lint = 1
  195. let g:pymode_lint_checker = "pyflakes,pep8"
  196. " Auto check on save
  197. let g:pymode_lint_write = 1
  198.  
  199. " Support virtualenv
  200. let g:pymode_virtualenv = 0
  201.  
  202. " Enable breakpoints plugin
  203. let g:pymode_breakpoint = 1
  204. let g:pymode_breakpoint_bind = '<leader>b'
  205.  
  206. " syntax highlighting
  207. let g:pymode_syntax = 1
  208. let g:pymode_syntax_all = 1
  209. let g:pymode_syntax_indent_errors = g:pymode_syntax_all
  210. let g:pymode_syntax_space_errors = g:pymode_syntax_all
  211.  
  212. " Don't autofold code
  213. let g:pymode_folding = 0
  214.  
  215. " Jedi-vim setup
  216. Bundle 'davidhalter/jedi-vim'
  217.  
  218. " vim-virtualenv
  219. Bundle 'jmcantrell/vim-virtualenv'
  220.  
  221. " Other setttings
  222.  
  223. " Use <leader>l to toggle display of whitespace
  224. nmap <leader>l :set list!<CR>
  225. " automatically change window's cwd to file's dir
  226. set autochdir
  227. " more subtle popup colors
  228. if has ('gui_running')
  229. highlight Pmenu guibg=#cccccc gui=bold
  230. endif
  231.  
  232. " Syntax check plugin
  233. Bundle 'scrooloose/syntastic'
  234.  
  235. " C language
  236. Bundle 'c.vim'
  237.  
  238.  
  239. " JavaScript language
  240. Bundle 'pangloss/vim-javascript'
  241.  
  242. " HTML5 support in VIM
  243. Bundle 'othree/html5.vim'
  244.  
  245. " JSON support
  246. Bundle 'elzr/vim-json'
  247.  
  248. " CSS3 support
  249. Bundle 'hail2u/vim-css3-syntax'
  250.  
  251. " RUST support
  252. Bundle 'rust-lang/rust.vim'
  253.  
  254. " Support a lot of languages in VIM
  255. " Bundle 'sheerun/vim-polyglot'
  256.  
  257. " NODE.js support
  258. Bundle 'moll/vim-node'
  259.  
  260. " PHP support
  261. Bundle 'stanangeloff/php.vim'
  262.  
  263. " JQUERY support
  264. Bundle 'nono/jquery.vim'
  265.  
  266. " ANGULAR support
  267. Bundle 'burnettk/vim-angular'
  268.  
  269. " INI files syntax support
  270. Bundle 'nvie/vim-ini'
  271.  
  272. " JINJA template language support
  273. Bundle 'hiphish/jinja.vim'
  274.  
  275. " HashiCorp plugins:
  276. " vim-consul
  277. " vim-nomadproject
  278. " vim-ottoproject
  279. " vim-packer
  280. " vim-terraform
  281. " vim-vagrant
  282. " vim-vaultproject
  283. Bundle 'hashivim/vim-hashicorp-tools'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement