dotfiles

Configuration files to dump into your home directory.
git clone git://git.swab.dev/dotfiles.git
Log | Files | Refs

init.vim (2998B)


      1 set nocompatible " be iMproved, required
      2 
      3 " junegunn/vim-plug
      4 call plug#begin('~/.local/share/nvim/plugs')
      5 " ------------- Plugins -------------
      6 " Plugin Manager -> junegunn/vim-plug
      7 call plug#begin(stdpath('data') . '/plugs')
      8 " Utility Plugins
      9 Plug 'neovim/nvim-lspconfig'    " Neovim Language Server (0.5.0+)
     10 Plug 'airblade/vim-gitgutter'   " On screen Git updates
     11 Plug 'nvim-lua/completion-nvim' " Auto completion
     12 Plug 'itchyny/vim-gitbranch'    " Git branch in status bar
     13 " Syntax Based Plugins
     14 Plug 'fatih/vim-go'
     15 Plug 'koalaman/shellcheck'
     16 Plug 'vim-syntastic/syntastic'
     17 " Theme Based Plugins
     18 Plug 'arcticicestudio/nord-vim'
     19 Plug 'itchyny/lightline.vim'    " Status line themes
     20 call plug#end()
     21 
     22 " ----------- Lua Scripts -----------
     23 " Must use Neovim 0.5.0+
     24 lua <<EOF
     25   lspconfig = require "lspconfig"
     26 
     27   lspconfig.gopls.setup {
     28     cmd = {"gopls", "serve"},
     29 		filetyes = {"go"},
     30     settings = {
     31       gopls = {
     32         analyses = {
     33           unusedparams = true,
     34         },
     35         staticcheck = true,
     36       },
     37     },
     38   }
     39 EOF
     40 " --------- End Lua Scripts ---------
     41 
     42 " ------ Colors & Highlighting ------
     43 syntax on
     44 colorscheme nord
     45 
     46 set colorcolumn=100
     47 highlight ColorColumn ctermbg=0
     48 
     49 " More Colors for Golang
     50 let g:go_highlight_types = 1
     51 let g:go_highlight_fields = 1
     52 let g:go_highlight_functions = 1
     53 let g:go_highlight_function_calls = 1
     54 
     55 " ----------- Status Line -----------
     56 set laststatus=2
     57 " For 'itchyny/lightline.vim' plugin
     58 set noshowmode
     59 let g:lightline = {
     60       \ 'colorscheme': 'nord',
     61 			\ 'active': {
     62       \   'left': [ [ 'mode', 'paste' ],
     63       \             [ 'readonly', 'filename', 'modified' ] ],
     64 			\   'right': [ [ 'lineinfo' ],
     65       \              [ 'percent' ],
     66       \              [ 'fileformat', 'fileencoding', 'filetype', 'gitbranch' ] ]
     67       \ },
     68       \ 'component_function': {
     69       \   'gitbranch': 'gitbranch#name'
     70       \ },
     71       \ }
     72 
     73 " ------- Interface Options ---------
     74 set number
     75 set noerrorbells
     76 set nowrap
     77 set cursorline
     78 set ruler
     79 set title
     80 set linebreak
     81 set showmatch " highlight matching {}[]() etc.
     82 
     83 " Search 
     84 set hlsearch
     85 set ignorecase
     86 set smartcase
     87 set incsearch " search while typing
     88 
     89 " Tab-competion for file-related tasks
     90 set path+=**
     91 
     92 " Display all matching file on tab complete
     93 set wildmenu
     94 
     95 " File-type specific indenting
     96 set autoindent
     97 
     98 " Setting Tabs 
     99 set tabstop=2     " How many columns a tab counts for
    100 set shiftwidth=2  " Display of vim tab commands such as `>` and `<`
    101 set softtabstop=0 
    102 set noexpandtab   " Don't change tabs to spaces
    103 
    104 " ------- Utility & Usability -------
    105 " No shift to enter command mode
    106 nnoremap ; :
    107 
    108 " Leader Keybindings
    109 let mapleader=","
    110 noremap <leader>q :wq<cr>
    111 
    112 "" Best used with Programmer Dvorak keyboard layout
    113 inoremap <leader>. <Esc>
    114 vnoremap <leader>. <Esc>
    115 set history=1000
    116 
    117 " Disable Arrow Keys
    118 no <up> <Nop>
    119 no <down> <Nop>
    120 no <left> <Nop>
    121 no <right> <Nop>
    122 ino <up> <Nop>
    123 ino <down> <Nop>
    124 ino <left> <Nop>
    125 ino <right> <Nop>
    126 vno <up> <Nop>
    127 vno <down> <Nop>
    128 vno <left> <Nop>
    129 vno <right> <Nop>