Created
March 6, 2023 14:50
-
-
Save weskerfoot/5367050e53be022bf9ad0e03f4ee561d to your computer and use it in GitHub Desktop.
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
set guifont=Menlo:h23 | |
set encoding=utf-8 | |
set tabpagemax=100 | |
scriptencoding utf-8 | |
set guitablabel=\[%N\]\ %t\ %M | |
execute pathogen#infect() | |
"set smartindent | |
set statusline+=%#warningmsg# | |
set statusline+=%{SyntasticStatuslineFlag()} | |
set statusline+=%* | |
let g:ycm_global_ycm_extra_conf = '/home/wes/.ycm_extra_conf.py' | |
"let g:syntastic_check_on_open = 0 | |
let g:syntastic_check_on_wq = 0 | |
let g:syntastic_mode_map = {'mode':'passive'} | |
" disable syntastic on the statusline | |
let g:statline_syntastic = 0 | |
nnoremap <F10> :SyntasticCheck<CR> :SyntasticToggleMode<CR> :w<CR> | |
set autoindent | |
set smartindent | |
set cindent | |
" default indent style | |
set tabstop=2 | |
set expandtab softtabstop=2 shiftwidth=2 | |
set cinoptions=(0 | |
let g:ycm_show_diagnostics_ui = 0 | |
set nocompatible " be iMproved, required | |
filetype off " required | |
filetype plugin on | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'ycm-core/YouCompleteMe' | |
Plugin 'prabirshrestha/asyncomplete.vim' | |
Plugin 'prabirshrestha/async.vim' | |
Bundle 'idanarye/vim-dutyl' | |
Bundle 'airblade/vim-rooter' | |
call vundle#end() " required | |
let g:dutyl_dontHandleFormat = 1 | |
let g:dutyl_dontHandleIndent = 1 | |
let g:lsp_diagnostics_echo_cursor = 1 | |
set completeopt-=preview | |
if has("autocmd") | |
filetype plugin indent on | |
endif | |
" redefines carriage return to be ctrl + y in popup menus | |
" I do NOT want it to insert a newline after I hit enter | |
inoremap <expr> <cr> ((pumvisible())?("\<C-y>"):("\<cr>")) | |
" allow for per-project vimrc | |
set exrc | |
if has("gui_running") | |
set guifont=Menlo \ 23 | |
endif | |
syntax on | |
set background=dark | |
colorscheme gruvbox | |
" Specify a directory for plugins | |
" - For Neovim: stdpath('data') . '/plugged' | |
" - Avoid using standard Vim directory names like 'plugin' | |
call plug#begin('~/.vim/plugged') | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' | |
Plug 'prabirshrestha/vim-lsp' | |
Plug 'rust-lang/rust.vim' | |
Plug 'prabirshrestha/asyncomplete-lsp.vim' | |
Plug 'mattn/vim-lsp-settings' | |
" Initialize plugin system | |
call plug#end() | |
command! -nargs=1 GJ vimgrep <q-args> % | copen | |
:vnoremap YP :!/home/wes/deindent.py \| yapf --style google<CR> | |
:vnoremap DI :!/home/wes/deindent.py<CR> | |
autocmd BufNewFile,BufRead *.rktd set filetype=scheme | |
autocmd BufNewFile,BufRead *.dockerfile set filetype=dockerfile | |
if executable('typescript-language-server') | |
au User lsp_setup call lsp#register_server({ | |
\ 'name': 'typescript-language-server', | |
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']}, | |
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'tsconfig.json'))}, | |
\ 'whitelist': ['typescript', 'typescript.tsx', 'typescriptreact'], | |
\ }) | |
let g:lsp_diagnostics_echo_cursor = 1 | |
endif | |
let s:nimlspexecutable = "nimlsp" | |
let g:lsp_log_verbose = 1 | |
let g:lsp_log_file = expand('/tmp/vim-lsp.log') | |
" for asyncomplete.vim log | |
let g:asyncomplete_log_file = expand('/tmp/asyncomplete.log') | |
let g:asyncomplete_auto_popup = 0 | |
if executable(s:nimlspexecutable) | |
au User lsp_setup call lsp#register_server({ | |
\ 'name': 'nimlsp', | |
\ 'cmd': {server_info->[s:nimlspexecutable]}, | |
\ 'whitelist': ['nim'], | |
\ }) | |
endif | |
if executable('rls') | |
au User lsp_setup call lsp#register_server({ | |
\ 'name': 'rls', | |
\ 'cmd': {server_info->['rustup', 'run', 'nightly', 'rls']}, | |
\ 'whitelist': ['rust'], | |
\ }) | |
endif | |
" DOESNT WORK | |
if executable('racket-lsp') | |
au User lsp_setup call lsp#register_server({ | |
\ 'name': 'racket-lsp', | |
\ 'cmd': 'racket-lsp', | |
\ 'whitelist': ['rkt'], | |
\ }) | |
endif | |
function! s:check_back_space() abort | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~ '\s' | |
endfunction | |
inoremap <silent><expr> <TAB> | |
\ pumvisible() ? "\<C-n>" : | |
\ <SID>check_back_space() ? "\<TAB>" : | |
\ asyncomplete#force_refresh() | |
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment