Skip to content

Instantly share code, notes, and snippets.

@drewknab
Created September 25, 2021 04:37
Show Gist options
  • Save drewknab/73fcccf5a5c1b5e6d225efbd43d46891 to your computer and use it in GitHub Desktop.
Save drewknab/73fcccf5a5c1b5e6d225efbd43d46891 to your computer and use it in GitHub Desktop.
nvim config
" Plugins will be downloaded under the specified directory.
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
" Declare the list of plugins.
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-vinegar'
Plug 'junegunn/seoul256.vim'
Plug 'flazz/vim-colorschemes'
Plug 'sheerun/vim-polyglot'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'https://gitlab.com/code-stats/code-stats-vim.git'
Plug 'vim-airline/vim-airline'
" List ends here. Plugins become visible to Vim after this call.
call plug#end()
set encoding=utf-8
set noswapfile " Swap files are just annoying
set backspace=indent,eol,start " Backspace works like a normal editor
set wildmenu " Tab through a menu in NORMAL mode
set lazyredraw " Technically speeds up load time
set nowrap " Wrapping is for suckers
set showcmd " See key commands as they happen
set splitbelow " Sensible splitting
set splitright " Sensible splitting
set tabstop=2 " Tabs, number of spaces
set softtabstop=2 " Fakes a mix of tabs/spaces forconsistency
set expandtab " Tabs are spaces not \t
set number " Show line numbers
set path+=** " Adds subfolders to path for searchin :find
set noshowmode
set laststatus=2
set colorcolumn=80
colorscheme seoul256
set incsearch " Updates search results while typing
set hlsearch " Highlights search results
set ignorecase " / searching ignores case
" CoC
set cmdheight=2
set updatetime=300
set nobackup
set nowritebackup
inoremap <silent><expr> <TAB>
\ pumvisible() ? coc#_select_confirm() :
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Fsharp
let g:fsharp#use_recommended_server_config = 1
call fsharp#getServerConfig()
let g:fsharp#automatic_reload_workspace = 1
let g:fsharp#fsi_command = "dotnet fsi"
let g:fsharp#fsi_keymap = "custom"
let g:fsharp#fsi_window_command = "botright 10new"
let g:fsharp#fsi_focus_on_send = 0
let g:fsharp#show_signature_on_cursor_move = 1
" CodeStats
let g:codestats_api_key = 'SFMyNTY.WkhKbGQydHVZV0k9IyNPRGN4.gCZA1I5NlWNH8a_Qrt5hDW1ZI1XaIMKGJUBSqVeMwAg'
" Airline
let g:airline_section_x = airline#section#create_right(['tagbar', 'filetype', '%{CodeStatsXp()}'])
" Maps
let mapleader="\<Space>"
nmap <Leader>ev :tabedit ~/.config/nvim/init.vim<cr>
nmap <Leader><space> :nohlsearch<cr>
nmap <Leader>t :tabedit<cr>
nmap <Leader>V :vsplit<cr>
nmap <Leader>H :split<cr>
" Fsharp Maps
vmap <leader>fi :call fsharp#sendSelectionToFsi()<cr><esc>
nmap <leader>fi :call fsharp#sendLineToFsi()<cr>
nmap <leader>ft :call fsharp#toggleFsi()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment