Skip to content

Instantly share code, notes, and snippets.

@bowmanjd
Last active September 9, 2020 17:57
Show Gist options
  • Save bowmanjd/06cd675b63532bdd85e0df45a184c210 to your computer and use it in GitHub Desktop.
Save bowmanjd/06cd675b63532bdd85e0df45a184c210 to your computer and use it in GitHub Desktop.
Old vimrc 2020-08-07
" Copyright (c) 2020 Jonathan Bowman
"
" Permission to use, copy, modify, and/or distribute this software for any
" purpose with or without fee is hereby granted.
"
" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
" AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
" OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
" PERFORMANCE OF THIS SOFTWARE.
set nocompatible
set mouse=a
set vb t_vb=
if has('gui_running')
set lines=35
set columns=120
if bufname('%') == ''
set bufhidden=wipe
endif
endif
if isdirectory('/mnt/c/WINDOWS')
set mouse-=a
endif
if has("win32") || has("win64")
set runtimepath=$HOME\.vim,$VIMRUNTIME,$HOME\.vim\after
set runtimepath^=~/.vim runtimepath+=~/.vim/after
"set runtimepath=$HOME/.vim,$VIMRUNTIME
if !has('nvim')
set pythonthreedll=python38.dll
" set pythondll=python27.dll
" let &pythondll='C:\Users\jbowman\scoop\apps\python27\current\python27.dll'
" set pythonhome='$HOME\scoop\apps\python27\current\'
" let &pythonthreedll='C:\Users\jbowman\scoop\apps\python\current\python37.dll'
" set pythonthreehome='$HOME\scoop\apps\python\current\'
endif
" let g:python3_host_prog = 'C:\Users\jbowman\scoop\apps\python\current\python.exe'
" let g:python_host_prog = 'C:\Users\jbowman\scoop\apps\python27\current\python.exe'
" let g:python_host_prog = 'C:\Python27\python.exe'
set guifont=Fira\ Code:h10
else
" let g:python_host_prog = '/usr/bin/python2'
" let g:python3_host_prog = '/usr/bin/python3'
" if !empty($ANDROID_ROOT)
" let g:python3_host_prog = '/data/data/com.termux/files/usr/bin/python3'
" endif
if isdirectory(getcwd() . "/venv")
let g:python3_host_prog = getcwd() . "/venv/bin/python"
endif
" if isdirectory(getcwd() . "/.venv")
" let g:python3_host_prog = getcwd() . "/.venv/bin/python"
" endif
endif
set fileformat=unix
set fileformats=unix,dos
" =======================
" Vim-plug initialization
"
let vim_plug_just_installed = 0
let vim_plug_path = expand('~/.vim/autoload/plug.vim')
if !filereadable(vim_plug_path)
echo "Installing Vim-plug..."
echo ""
silent !mkdir -p ~/.vim/autoload
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
let vim_plug_just_installed = 1
endif
" manually load vim-plug the first time
if vim_plug_just_installed
:execute 'source '.fnameescape(vim_plug_path)
endif
call plug#begin('~/.vim/plugged')
" Plugins
Plug 'Konfekt/FastFold',
Plug 'tmhedberg/SimpylFold',
Plug 'vim-scripts/indentpython.vim',
Plug 'nathanaelkane/vim-indent-guides'
Plug 'tpope/vim-fugitive',
Plug 'tpope/vim-surround'
Plug 'vim-airline/vim-airline'
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'dkarter/bullets.vim'
Plug 'dense-analysis/ale'
Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2-bufword'
Plug 'ncm2/ncm2-path'
Plug 'ncm2/ncm2-cssomni'
Plug 'ncm2/ncm2-jedi'
Plug 'ncm2/ncm2-go'
Plug 'ncm2/ncm2-markdown-subscope'
Plug 'ncm2/ncm2-html-subscope'
Plug 'ncm2/ncm2-tern', {'do': 'npm install'}
Plug 'kylef/apiblueprint.vim'
Plug 'petobens/poet-v'
let g:poetv_executables = ['poetry']
let g:poetv_auto_activate = 1
let g:poetv_set_environment = 1
if !has('nvim')
Plug 'roxma/vim-hug-neovim-rpc'
endif
"
"Plug 'godlygeek/tabular'
"Plug 'plasticboy/vim-markdown'
"Plug 'ncm2/ncm2-tmux'
"Plug 'vim-pandoc/vim-pandoc'
"Plug 'vim-pandoc/vim-pandoc-syntax'
"Plug 'ap/vim-css-color',
"Plug 'ambv/black',
"Plug 'neomake/neomake'
"Plug 'Valloric/YouCompleteMe'
"Plug 'nvie/vim-flake8',
"Plug 'tpope/vim-sensible'
"Plug 'scrooloose/syntastic'
"Plug 'fatih/vim-go',
"Plug 'stanangeloff/php.vim',
"Plug 'cakebaker/scss-syntax.vim',
"Plug 'pangloss/vim-javascript',
"Plug 'elzr/vim-json',
"Plug 'cespare/vim-toml',
"Plug 'vim-scripts/txt2tags',
"Plug 'sudar/vim-arduino-syntax',
"Plug 'hail2u/vim-css3-syntax',
"Plug 'posva/vim-vue',
"Plug 'vim-scripts/jQuery'
"Plug 'lambdatoast/elm.vim'
call plug#end()
autocmd BufEnter * call ncm2#enable_for_buffer()
set completeopt=noinsert,menuone,noselect
" Bullets.vim
let g:bullets_enabled_file_types = [
\ 'markdown',
\ 'text',
\ 'gitcommit',
\ 'scratch'
\]
let g:ale_linters = {
\ 'python': ['flake8', 'mypy'],
\}
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'sh': ['shfmt'],
\ 'css': ['prettier'],
\ 'json': ['fixjson'],
\ 'markdown': ['prettier'],
\ 'go': ['gofmt'],
\ 'html': ['prettier'],
\ 'javascript': ['prettier_eslint'],
\ 'python': ['black', 'isort'],
\ 'scss': ['prettier'],
\ 'rust': ['rustfmt'],
\}
let g:ale_python_flake8_use_global = 1
let g:ale_python_flake8_executable = 'flake8helled'
let g:ale_fix_on_save = 1
let g:ale_rust_cargo_use_check = 1
let g:ale_rust_cargo_check_tests = 1
let g:ale_rust_cargo_check_examples = 1
let g:airline#extensions#ale#enabled = 1
let g:indent_guides_enable_on_vim_startup = 1
let python_highlight_all=1
syntax enable
set number
set cursorline
set ai
set si
colorscheme torte
set background=dark
set nobackup
set nowrap
set clipboard=unnamed
set tabstop=2
set expandtab
set shiftwidth=2
set nohlsearch
set viminfo^=!
set encoding=utf-8
"set foldmethod=indent
"set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za
augroup VimCSS3Syntax
autocmd!
autocmd FileType css setlocal iskeyword+=-
augroup END
"au BufNewFile,BufRead *.vue setf vue
"au BufNewFile,BufRead *.t2t set ft=txt2tags formatoptions=l lbr wrap textwidth=0 wrapmargin=0 nolist
au BufNewFile,BufRead *.md set spell spelllang=en_us ft=markdown formatoptions=l lbr wrap textwidth=0 wrapmargin=0 nolist
au BufNewFile,BufRead *.t2t set spell spelllang=en_us ft=markdown formatoptions=l lbr wrap textwidth=0 wrapmargin=0 nolist
au BufNewFile,BufRead *.sql,*.csv set ignorecase smartcase
"au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
"au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
autocmd BufNewFile,BufReadPost *.ino,*.pde set filetype=cpp
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
map <C-n> :NERDTreeToggle<CR>
"split navigations
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>
let g:airline#extensions#tabline#enabled = 1
set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
set guioptions-=T
if !has('nvim')
set guiheadroom=0
else
tnoremap <Esc> <C-\><C-n>
endif
if exists('g:fvim_loaded')
set guifont=Fira\ Code:h13
" Ctrl-ScrollWheel for zooming in/out
nnoremap <silent> <C-ScrollWheelUp> :set guifont=+<CR>
nnoremap <silent> <C-ScrollWheelDown> :set guifont=-<CR>
nnoremap <A-CR> :FVimToggleFullScreen<CR>
"colorscheme torte
"FVimFontLcdRender v:false
FVimFontAntialias v:true
FVimFontAutohint v:true
FVimFontHintLevel 'full'
FVimFontLigature v:true
FVimFontSubpixel v:true
set mouse=a
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment