Skip to content

Instantly share code, notes, and snippets.

@abatkin
Created January 28, 2021 06:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abatkin/bf52062258f6688482d2338ac3981eb8 to your computer and use it in GitHub Desktop.
Save abatkin/bf52062258f6688482d2338ac3981eb8 to your computer and use it in GitHub Desktop.
Vim testing on Windows
"call pathogen#infect()
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'mileszs/ack.vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'vim-scripts/synic.vim'
Plugin 'godlygeek/tabular'
Plugin 'majutsushi/tagbar'
Plugin 'bitc/vim-bad-whitespace'
Plugin 'vim-airline/vim-airline'
Plugin 'tpope/vim-vividchalk'
Plugin 'rphillips/vim-zoomwin'
Plugin 'scrooloose/syntastic'
Plugin 'mihaifm/bck'
Plugin 'jeetsukumaran/vim-buffergator'
Plugin 'plasticboy/vim-markdown'
Plugin 'tpope/vim-characterize'
Plugin 'tpope/vim-commentary'
Plugin 'elzr/vim-json'
Plugin 'abatkin/highlight.vim'
Plugin 'vimwiki/vimwiki'
Plugin 'tpope/vim-fugitive'
Plugin 'guns/vim-clojure-highlight'
Plugin 'tpope/vim-salve'
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'tpope/vim-fireplace'
Plugin 'rust-lang/rust.vim'
Plugin 'cespare/vim-toml'
call vundle#end()
syntax enable
filetype plugin indent on
set nocompatible
"if filereadable("$VIMRUNTIME/mswin.vim")
" :so $VIMRUNTIME/mswin.vim
"endif
":behave mswin
set background=dark
if has("gui_running")
set nu
set guifont=FiraCode_NF:h9:cANSI:qDRAFT
set guioptions-=T
set lines=50
set columns=140
let g:airline_powerline_fonts = 1
else
let g:airline_powerline_fonts = 1
set t_Co=256
endif
colorscheme vividchalk
autocmd ColorScheme * hi Search ctermbg=DarkBlue
set shiftwidth=2
set tabstop=2
set expandtab
set noautowrite
set hidden
set autoindent smartindent
set smarttab
set history=200
set incsearch
set ignorecase
set hlsearch
set showmatch
set nobackup
set backspace=indent,eol,start
set encoding=utf-8
set laststatus=2
set wildignore=*.swp,*.zip,.svn/*,*.class,*.jar
set tags=./tags;/
vmap <Tab> >gv
vmap <S-Tab> <gv
let g:buffergator_viewport_split_policy = "B"
let g:buffergator_autoexpand_on_split = 0
let g:buffergator_split_size = 0
let g:buffergator_sort_regime = "mru"
let g:ctrlp_mruf_case_sensitive = 0
let g:ctrlp_mruf_last_entered = 1
let g:ctrlp_dotfiles = 0
let g:ctrlp_working_path_mode = 0
let g:vimwiki_list = [
\ {'path': 'h:/Documents/notes', 'ext': '.txt'}
\ ]
let g:tagbar_type_vimwiki = {
\ 'ctagstype': 'wiki',
\ 'sort': 0,
\ 'kinds' : [
\ 'h:header',
\ ]
\}
let tlist_vimwiki_settings = "wiki;h:header"
let g:vimwiki_global_ext=0
vnoremap <leader>q :<c-u>call <SID>QuoteLines()<cr>
vnoremap <leader>j :<c-u>call <SID>JoinLines()<cr>
vmap <leader>s <leader>qgv<leader>j
function! s:JoinLines()
silent! execute "normal! gv:\<c-u>'<,'>-1s/\\v$/,/g\<cr>gvJ"
endfunction
function! s:QuoteLines()
silent! execute "normal! gv:s/\\v(^\\s*)([^[:space:]].{-})(\\s*$)/\\1'\\2'\\3/\<CR>"
endfunction
nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
" Fix copy and paste
map <S-Insert> "+gP
cmap <S-Insert> <C-R>+
exe 'inoremap <script> <S-Insert>' paste#paste_cmd['i']
" Select All (Visual)
noremap <C-A> ggVG
"This allows for change paste motion cp{motion}
"Borrowed from http://stackoverflow.com/questions/2471175/vim-replace-word-with-contents-of-paste-buffer
nmap <silent> cp :set opfunc=ChangePaste<CR>g@
function! ChangePaste(type, ...)
silent exe "normal! `[v`]\"_c"
silent exe "normal! p"
endfunction
let g:ackprg = "rg --vimgrep"
let g:ack_default_opts = "--smart-case"
let g:ack_autoclose = 0
let g:ackhighlight = 1
let g:vim_markdown_folding_style_pythonic = 1
set nomodeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment