Skip to content

Instantly share code, notes, and snippets.

@redlotus
Last active September 24, 2019 07:00
Show Gist options
  • Save redlotus/53fd9ce9f2ee95ffb1cd9851e1150dc7 to your computer and use it in GitHub Desktop.
Save redlotus/53fd9ce9f2ee95ffb1cd9851e1150dc7 to your computer and use it in GitHub Desktop.
init.vim
set nocompatible
" enable plugins
filetype on
syntax enable
" basic settings
set laststatus=2 " Always show the statusline
"set term=$TERM
set encoding=utf-8 " Necessary to show unicode glyphs
" if $TERM!="linux" " if we are not in tty
" set t_Co=256 " Tell that terminal supports 256 colors
" endif
set tabstop=4 " Number of spaces that a <Tab> in the file counts for.
set softtabstop=4 " insert/delete 4 spaces when hitting a TAB/BACKSPACE
set shiftwidth=4 " Number of spaces to use for each step of (auto)indent.
set expandtab " insert space when hitting TABs
set shiftround " round indent to multiple of 'shiftwidth'
set autoindent " auto indentation
set cindent " c indentation
set nu " Toggle line numbering
set noruler " Display the cursor position, using powerline instead to show stats
set noswapfile " no swap files
set linebreak
set ignorecase " ignore case in search
set smartcase " if uppercase letter, dont ignore
" set ttyfast " yes we have fast terminal connection
set shell=bash
set backspace=indent,eol,start " backspace behavior (indent -> eol -> start)
set backup " backup :)
set backupdir=~/.config/nvim/backup " backup directory
set pumheight=15 " limit popup menu height
set termguicolors
set noerrorbells
set visualbell
set exrc
call plug#begin('~/.config/nvim/plugged/')
" My Bundles here:
"Plug 'chriskempson/base16-vim'
Plug 'iCyMind/NeoSolarized'
Plug 'rust-lang/rust.vim'
Plug 'sbdchd/neoformat'
" Plug 'scrooloose/nerdtree'
Plug 'plasticboy/vim-markdown'
Plug 'tpope/vim-fugitive'
function! DoRemote(arg)
UpdateRemotePlugins
endfunction
Plug 'tpope/vim-surround'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'zchee/deoplete-jedi'
Plug 'sebastianmarkow/deoplete-rust'
" Plug 'mhartington/nvim-typescript'
" Plug 'bling/vim-bufferline'
Plug 'mileszs/ack.vim'
"Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
"Plug '/usr/local/bin/fzf'
"Plug 'junegunn/fzf.vim'
Plug 'Yggdroot/LeaderF', { 'do': './install.sh' }
" typescript
" Plug 'leafgarland/typescript-vim'
" Presentation
"Plug 'tybenz/vimdeck'
"Plug 'inkarkat/vim-SyntaxRange'
" clojure
"Plug 'tpope/vim-fireplace'
Plug 'tpope/vim-surround'
" Plug 'clojure-vim/acid.nvim', { 'do': ':UpdateRemotePlugins' }
" Plug 'vim-syntastic/syntastic' replaced by ale
Plug 'OmniSharp/omnisharp-vim'
Plug 'w0rp/ale'
"Plug 'herrbischoff/cobalt2.vim'
""Plug 'alaviss/nim.nvim'
Plug 'morhetz/gruvbox'
Plug 'liuchengxu/vista.vim'
Plug 'itchyny/lightline.vim'
Plug 'ayu-theme/ayu-vim'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'wsdjeg/vim-lua'
Plug 'zchee/deoplete-clang'
Plug 'Shougo/neoinclude.vim'
Plug 'ziglang/zig.vim'
call plug#end()
filetype plugin indent on
" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
" Font and color settings
" solarized
"function! GetCurrentBackground()
" return !has('gui_running') || (strftime('%H') > 6 && strftime('%H') < 18) ? 'light' : 'dark'
"endfunction
"
"exec 'set background=' . GetCurrentBackground()
set background=dark
"let g:solarized_termcolors=16
colorscheme NeoSolarized
"let ayucolor="light"
"colorscheme ayu
" code folding
set foldmethod=indent
set foldlevel=99
" hilight under cursor
set cursorline " enable hilight
" hi cursorline cterm=NONE ctermbg=252
" hi cursorcolumn cterm=NONE ctermbg=252
" Complete options (disable preview scratch window)
" set completeopt = menu,menuone,longest
" SuperTab option for context aware completion
" let g:SuperTabDefaultCompletionType='context'
" set completeopt=menuone,longest,preview
" fzf
" set rtp+=~/.fzf
" airline
"let g:airline_powerline_fonts = 1
" netrw
let g:netrw_banner = 0
let g:netrw_browse_split = 4
" deoplete
let g:deoplete#enable_at_startup = 1
" ag
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
" vista
let g:vista#renderer#enable_icon = 0
" move around
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h
" auto closing
inoremap " ""<left>
inoremap ' ''<left>
inoremap ( ()<left>
inoremap [ []<left>
inoremap { {}<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {;<CR> {<CR>};<ESC>O
" keybindings
nmap <silent> <F2> :Vista!!<CR>
" formatter
"let g:formatter_yapf_style = 'google'
" clang
let g:deoplete#sources#clang#libclang_path = '/usr/local/Cellar/llvm/8.0.1/lib/libclang.dylib'
let g:deoplete#sources#clang#clang_header = '/usr/local/opt/llvm/lib/clang/'
" golang
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'
"let g:ale_linters = {
" \ 'go': ['gopls'],
" \}
call deoplete#custom#option('omni_patterns', { 'go': '[^. *\t]\.\w*' })
" python
let g:python_host_prog = 'python2'
let g:python3_host_prog = 'python3'
let g:deoplete#sources#jedi#enable_typeinfo = 0
" rust
let g:formatters_rs = ['/home/redlotus/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustfmt']
let g:deoplete#sources#rust#racer_binary = '/home/redlotus/.cargo/bin/racer'
let g:deoplete#sources#rust#rust_source_path = '/home/redlotus/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/'
let g:deoplete#sources#rust#show_duplicates = 1
" php
"let g:neoformat_php_php_beautifier = {
" \ 'exe': 'php_beautifier',
" \ 'args': ['--filters "NewLines(before=if:switch:T_CLASS,after=T_COMMENT:function)"']
" \ }
"let g:neoformat_enabled_php = ['php_beautifier']
" dotnet
" let g:OmniSharp_selector_ui = 'fzf'
" 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 = 0
"let g:syntastic_check_on_wq = 0
"let g:OmniSharp_server_user_mono = 1
" ale
let g:ale_set_highlights = 1
"function! FzyCommand(choice_command, vim_command)
" try
" let output = system(a:choice_command . " | fzy ")
" catch /Vim:Interrupt/
" " Swallow errors from ^C, allow redraw! below
" endtry
" redraw!
" if v:shell_error == 0 && !empty(output)
" exec a:vim_command . ' ' . output
" endif
"endfunction
"nnoremap <leader>e :call FzyCommand("ag . --silent -l -g ''", ":e")<cr>
"nnoremap <leader>v :call FzyCommand("ag . --silent -l -g ''", ":vs")<cr>
"nnoremap <leader>s :call FzyCommand("ag . --silent -l -g ''", ":sp")<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment