Last active
May 27, 2020 21:37
-
-
Save eddyekofo94/c93d071aea298b483f188d63c5e9c127 to your computer and use it in GitHub Desktop.
Sample Vim config with plugins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filetype off " required | |
if has('nvim') || has('termguicolors') | |
set termguicolors | |
endif | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'tpope/vim-dispatch.git' | |
Plugin 'OmniSharp/omnisharp-vim' | |
Plugin 'honza/vim-snippets' | |
Plugin 'elzr/vim-json' | |
Plugin 'plasticboy/vim-markdown' | |
Plugin 'bling/vim-airline' | |
Plugin 'majutsushi/tagbar' | |
Plugin 'Chiel92/vim-autoformat' | |
Plugin 'scrooloose/nerdtree' | |
Plugin 'Xuyuanp/nerdtree-git-plugin' | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'scrooloose/syntastic' | |
Plugin 'jiangmiao/auto-pairs' | |
Plugin 'chriskempson/base16-vim' | |
Plugin 'challenger-deep-theme/vim', {'name': 'challenger-deep-theme'} | |
Plugin 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'} | |
Plugin 'junegunn/vim-easy-align' | |
Plugin 'airblade/vim-gitgutter' | |
Plugin 'rust-lang/rust.vim' | |
Plugin 'mattn/webapi-vim' | |
" All of your Plugins must be added before the following line | |
call vundle#end() " required | |
filetype plugin indent on " required | |
" will enable automatic running of :RustFmt when you save a buffer | |
let g:rustfmt_autosave = 1 | |
" If you set g:rust_clip_command RustPlay will copy the url to the clipboard | |
let g:rust_clip_command = 'pbcopy' | |
set autoread | |
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable | |
" delays and poor user experience. | |
set updatetime=300 | |
" Give more space for displaying messages. | |
set cmdheight=2 | |
let g:AutoPairsFlyMode = 1 | |
let base16colorspace=256 " Access colors present in 256 colorspace | |
" the 'hidden' option, which allows you to re-use the same | |
" window and switch from an unsaved buffer without saving it first. Also allows | |
" you to keep an undo history for multiple files when re-using the same window | |
" in this way. Note that using persistent undo also lets you undo in multiple | |
" files even in the same window, but is less efficient and is actually designed | |
" for keeping undo history after closing Vim entirely. Vim will complain if you | |
" try to quit without saving, and swap files will keep you safe if your computer | |
" crashes. | |
set hidden | |
" Better command-line completion | |
set wildmenu | |
" Use case insensitive search, except when using capital letters | |
set ignorecase | |
set smartcase | |
set ic | |
set hls is | |
" Open new split panes to right and bottom, which feels more natural than Vim’s default: | |
set splitbelow | |
set splitright | |
"We can use different key mappings for easy navigation between splits to save a keystroke. | |
"So instead of ctrl-w then j, it’s just ctrl-j: | |
nnoremap <C-J> <C-W><C-J> | |
nnoremap <C-K> <C-W><C-K> | |
nnoremap <C-L> <C-W><C-L> | |
nnoremap <C-H> <C-W><C-H> | |
" Allow backspacing over autoindent, line breaks and start of insert action | |
set backspace=indent,eol,start | |
" When opening a new line and no filetype-specific indenting is enabled, keep | |
" the same indent as the line you're currently on. Useful for READMEs, etc. | |
set autoindent | |
" Stop certain movements from always going to the first character of a line. | |
" While this behaviour deviates from that of Vi, it does what most users | |
" coming from other editors would expect. | |
set nostartofline | |
" Display the cursor position on the last line of the screen or in the status | |
" line of a window | |
set ruler | |
" Always display the status line, even if only one window is displayed | |
set laststatus=2 | |
" Instead of failing a command because of unsaved changes, instead raise a | |
" dialogue asking if you wish to save changed files. | |
set confirm | |
" Use visual bell instead of beeping when doing something wrong | |
set visualbell | |
" Enable use of the mouse for all modes | |
set mouse=a | |
" Set the command window height to 2 lines, to avoid many cases of having to | |
" "press <Enter> to continue" | |
set cmdheight=2 | |
" Indentation settings for using 4 spaces instead of tabs. | |
" Do not change 'tabstop' from its default value of 8 with this setup. | |
set shiftwidth=4 | |
set softtabstop=4 | |
set expandtab | |
set smartindent | |
" Checks for spelling | |
"set spell | |
syntax on | |
set encoding=utf-8 | |
" set numbers on files | |
:set nu | |
" Colour scheme | |
"set background=dark | |
colorscheme challenger_deep | |
filetype plugin indent on | |
" Use <c-space> to trigger completion. | |
"inoremap <silent><expr> <c-space> coc#refresh() | |
" Syntastic | |
set statusline+=%#warningmsg# | |
set statusline+=%{SyntasticStatuslineFlag()} | |
set statusline+=%* | |
let g:syntastic_always_populate_loc_list = 1 | |
let g:syntastic_auto_loc_list = 1 | |
let g:syntastic_check_on_open = 1 | |
let g:syntastic_check_on_wq = 0 | |
" Add `:Format` command to format current buffer. | |
command! -nargs=0 Format :call CocAction('format') | |
let NERDTreeShowHidden=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment