Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
154 lines (131 sloc) 5.97 KB
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
Plugin 'VundleVim/Vundle.vim' " let Vundle manage Vundle, required
" install plugins: Launch vim and run :PluginInstall
"
Plugin 'tpope/vim-fugitive' " plugin on GitHub repo
Plugin 'vim-python/python-syntax' "https://github.com/vim-python/python-syntax
let g:python_highlight_all = 1
Plugin 'w0rp/ale'
Plugin 'tpope/vim-unimpaired.git' " some great key bindings like quickfix nav
Plugin 'ervandew/supertab.git' " allow tab completion
Plugin 'reasonml-editor/vim-reason-plus' " https://github.com/reasonml-editor/vim-reason-plus
Plugin 'keith/swift.vim.git' " https://github.com/keith/swift.vim
Plugin 'craigemery/vim-autotag'
Plugin 'pangloss/vim-javascript' " https://github.com/pangloss/vim-javascript
Plugin 'leafgarland/typescript-vim' " https://github.com/leafgarland/typescript-vim
Plugin 'dart-lang/dart-vim-plugin' " https://github.com/dart-lang/dart-vim-plugin
Plugin 'mxw/vim-jsx' " https://github.com/mxw/vim-jsx
if has('conceal')
Plugin 'Yggdroot/indentLine' " display vertical lines at each indentation level
endif
" plugins for vim language server protocol support (per https://github.com/prabirshrestha/vim-lsp)
Plugin 'prabirshrestha/async.vim'
Plugin 'prabirshrestha/vim-lsp'
Plugin 'Zaptic/elm-vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required, load filetype-specific intend files
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief vundle help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" set the <Leader> and <LocalLeader> to be the space bar
let mapleader="\<Space>"
let maplocalleader="\<Space>"
" map {space bar + o} to open current buffer directory
nnoremap <Leader>o :!open %:h<cr>
" ALE (below settings make ale only run when a file is saved)
let g:ale_lint_on_enter = 0 " disable ale from running when a file is opened
let g:ale_lint_on_text_changed = 'never' " disable ale from running when text is changed
let g:ale_lint_on_save = 1 " set ale to run when a file is saved
" stifles errors for libraries (eg boto3) not yet in typeshed
let g:ale_python_mypy_options = '--ignore-missing-imports' " mypy --ignore-missing imports
if filereadable("etc/pylintrc")
let g:ale_python_pylint_options="--rcfile=etc/pylintrc"
endif
let g:ale_open_list = 1 " show ale errors/warnings in quickfix
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
let g:indentLine_fileTypeExclude = ['json'] " don't conceal json files
" Dart
let dart_format_on_save = 1 " run :DartFmt on save
let dart_style_guide = 2 " enabled style guide syntax (like 2-space indentation)
if !exists("g:syntax_on")
syntax enable " turn syntax highlighting on
endif
colorscheme darcula
set number " show line numbers
set wrap lbr " wrap whole words instead of breaking words up
set autoindent " Copy indent from current line when starting an new line (works nicely with format option `n` for lists)
set showcmd " show commands in bottom right
set showmatch " highlight matching [{(
set cursorline " highlight current line
set ruler " show current line number and line count
set hls is " set highlight search and inline highlighting when typing a search
set hidden " leave file unsaved in current buffer
set grepprg=ack " have grep use ack behind the scenes. install ack first: brew install ack
set backspace=2 " make backspace work like most other programs
set wildmenu " visual autocomplete for command menu
set spell spelllang=en_us " set spell checking :)
set t_ti= t_te= " show results from terminal commands within vim!
set ignorecase " ignore case when searcing with `/`. use `/\C` for case sensitive search
" search down into subfolders
" provides tab-completion for all file-related tasks
"
" can use `:find *{name}` to quickly find a file with partial name
set path+=**
" Set spacing
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd Filetype ruby setlocal softtabstop=2 shiftwidth=2 softtabstop=2
autocmd Filetype javascript setlocal softtabstop=2 shiftwidth=2 softtabstop=2
" Show fugitive Gdiff in vertical windows
set diffopt+=vertical
" Set up statusline
set laststatus=2 " always show the vim status line
set statusline+=%{fugitive#statusline()}
set statusline+=%= " separate left status from right
set statusline+=\ %y " file type
set statusline+=\ L:%l,\ C:%c%V,\ Hex:%B " line, column, hex value under cursor
set statusline+=\ %P " percent through file
" turn off highlighting
autocmd BufNewFile,BufRead *.markdown syn match markdownIgnore "_"
autocmd BufNewFile,BufRead *.markdown syn match markdownIgnore "*"
autocmd BufNewFile,BufRead *.md syn match markdownIgnore "_"
autocmd BufNewFile,BufRead *.md syn match markdownIgnore "*"
" next ale error
nmap <silent> <C-j> <Plug>(ale_next_wrap)
" connect to the swift source kit lsp
if executable('sourcekit-lsp')
au User lsp_setup call lsp#register_server({
\ 'name': 'sourcekit-lsp',
\ 'cmd': {server_info->['sourcekit-lsp']},
\ 'whitelist': ['swift'],
\ })
endif
" -- Dart --
if executable('dart_language_server')
au User lsp_setup call lsp#register_server({
\ 'name': 'dart_language_server',
\ 'cmd': {server_info->['dart_language_server']},
\ 'whitelist': ['dart'],
\ })
nnoremap <Leader>d :LspHover<cr>
endif
function! HotReload() abort
if !empty(glob("/tmp/flutter.pid"))
silent execute '!kill -SIGUSR1 "$(cat /tmp/flutter.pid)"'
endif
endfunction
autocmd BufWritePost *.dart call HotReload()
You can’t perform that action at this time.