Skip to content

Instantly share code, notes, and snippets.

@matejsarlija
Created January 17, 2022 18:36
Show Gist options
  • Save matejsarlija/7ad698221c14ce6b3fbb844735584ab5 to your computer and use it in GitHub Desktop.
Save matejsarlija/7ad698221c14ce6b3fbb844735584ab5 to your computer and use it in GitHub Desktop.
call plug#begin(stdpath('data') . '/plugged')
Plug 'ryanoasis/vim-devicons'
" fugitive - git support
Plug 'tpope/vim-fugitive'
Plug 'shougu/unite.vim'
"autocompletion related
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'deoplete-plugins/deoplete-lsp'
" F# related
Plug 'ionide/Ionide-vim', {
\ 'do': 'make fsautocomplete',
\}
"scala-metals + required
Plug 'hrsh7th/vim-vsnip'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-vsnip'
Plug 'nvim-lua/plenary.nvim'
"Plug 'scalameta/nvim-metals'
" tree icons
Plug 'ryanoasis/vim-devicons'
"neo js
Plug 'vimlab/neojs'
" " Conjure
Plug 'Olical/conjure'
" vim-racket
Plug 'wlangstroth/vim-racket'
"statusline - airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
"brackets
Plug 'jiangmiao/auto-pairs'
" nerd tree
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" surround vim
Plug 'tpope/vim-surround'
" nerd commenter
Plug 'scrooloose/nerdcommenter'
" Python syntax extra
Plug 'vim-python/python-syntax'
"scala-metals + required
Plug 'hrsh7th/vim-vsnip'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-vsnip'
Plug 'nvim-lua/plenary.nvim'
" colorscheme
Plug 'nanotech/jellybeans.vim'
Plug 'morhetz/gruvbox'
Plug 'w0ng/vim-hybrid'
Plug 'tpope/vim-vividchalk'
Plug 'jacoborus/tender.vim'
Plug 'zacanger/angr.vim'
Plug 'endel/vim-github-colorscheme'
Plug 'wimstefan/Lightning'
Plug 'jonathanfilip/vim-lucius'
Plug 'dikiaap/minimalist'
Plug 'tomasr/molokai'
Plug 'fmoralesc/molokayo'
Plug 'kyoz/purify'
Plug 'lifepillar/vim-solarized8'
Plug 'jaredgorski/spacecamp'
Plug 'marcopaganini/termschool-vim-theme'
Plug 'vim-scripts/twilight256.vim'
Plug 'vim-scripts/wombat256.vim'
Plug 'vim-scripts/pyte'
Plug 'vim-scripts/mayansmoke'
" glsl color
Plug 'tikhomirov/vim-glsl'
"themes
Plug 'drewtempelmeyer/palenight.vim'
Plug 'romainl/Apprentice'
Plug 'rakr/vim-one'
Plug 'jdsimcoe/abstract.vim'
call plug#end()
let g:airline#extensions#tabline#enabled = 1
" ================ Suggestions ======================
" show wild menu (menu of suggestions) when typing commands in command mode
set path+=**
set wildmenu
set showcmd
" ================ File management ==================
" Turn off swap files
set noswapfile
set nobackup
set nowb
" ================ Visualization ====================
"syntax on
"set background=dark
if (has("termguicolors"))
set termguicolors
endif
hi clear
if exists("syntax_on")
syntax reset
endif
let g:python_highlight_all = 1
syntax on
syntax enable
"set background=dark
colorscheme pyte
"for syntax
"
"
"" ================ Indentation ======================
" use mouse in all modes
set mouse=a
"
"set autoindent
set smartindent
set shiftwidth=4
set tabstop=4
set smarttab
set expandtab
" ================ Number column ====================
" numbers
set number " see the line number column
" Toggle relative numbering, and set to absolute on loss of focus or insert mode
autocmd InsertEnter * :set nornu
autocmd InsertLeave * :set rnu
" we don't want to see relative numbering while debugging
" debugger uses its own window, so we can disable rnu when source window loses
" focus
autocmd BufLeave * :set nornu
autocmd BufEnter * call SetRNU()
function! SetRNU()
if(mode()!='i')
set rnu
endif
endfunction
" global
"
let mapleader = ","
let g:mapleader = ","
"F#
" configure deoplete
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option({
\ 'auto_complete_delay': 100,
\ })
" LSP
"-----------------------------------------------------------------------------
" nvim-lsp Mappings
"-----------------------------------------------------------------------------
nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>
nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
nnoremap <silent> gds <cmd>lua vim.lsp.buf.document_symbol()<CR>
nnoremap <silent> gws <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
nnoremap <silent> <leader>rn <cmd>lua vim.lsp.buf.rename()<CR>
nnoremap <silent> <leader>f <cmd>lua vim.lsp.buf.formatting()<CR>
nnoremap <silent> <leader>ca <cmd>lua vim.lsp.buf.code_action()<CR>
nnoremap <silent> <space>d <cmd>lua vim.lsp.diagnostic.set_loclist()<CR>
nnoremap <silent> [c <cmd>lua vim.lsp.diagnostic.goto_prev { wrap = false }<CR>
nnoremap <silent> ]c <cmd>lua vim.lsp.diagnostic.goto_next { wrap = false }<CR>
" Scala completion related settings
" This is similiar to what I use
" ================ Performance ======================
" fix slow scrolling that occurs when using mouse and relative numbers
set lazyredraw
" vim timeout (forgot why I need this or if I do at all)
set ttyfast
set ttimeoutlen=10
" ================ Misc =============================
" highlight matching braces
set showmatch
" How many tenths of a second to blink when matching brackets
set mat=0
" When the last window will have a status line (2 = always)
set laststatus=2
" disable wrapping of long lines into multiple lines
set nowrap
" history
set history=1000
" on some systems the backspace does not work as expected.
" this fixes the problem
set backspace=indent,eol,start
" to avoid hitting:
" 'press ENTER or type command to continue'
" add 'silent' keyword before the command
"
" ################ NERDTree #########################
" shift+i (show hidden files)
" ctrl+n open/closes nerd tree
noremap <C-n> :NERDTreeToggle<CR>
" quit nerd tree on file open
let g:NERDTreeQuitOnOpen = 1
" show nerd tree always on the right instead on the left
"let g:NERDTreeWinPos = "right"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment