nvim/init.vim

150 lines
4.5 KiB
VimL
Raw Normal View History

2022-10-05 19:22:26 +00:00
call plug#begin()
2022-10-06 12:01:05 +00:00
" NERDTree stuff
2022-10-21 08:53:31 +00:00
Plug 'nvim-tree/nvim-web-devicons' " optional, for file icons
Plug 'nvim-tree/nvim-tree.lua'
2022-10-05 19:22:26 +00:00
2022-10-21 08:53:31 +00:00
" neovim lsp plugins and depencencies
2022-10-15 11:50:50 +00:00
Plug 'neovim/nvim-lspconfig'
2022-10-27 17:14:44 +00:00
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/nvim-cmp'
Plug 'williamboman/mason.nvim'
Plug 'williamboman/mason-lspconfig.nvim'
Plug 'mfussenegger/nvim-lint'
Plug 'onsails/lspkind.nvim'
2022-10-27 17:14:44 +00:00
2022-10-19 13:11:04 +00:00
" various plugins
Plug 'lewis6991/gitsigns.nvim'
Plug 'petertriho/nvim-scrollbar'
Plug 'kevinhwang91/nvim-hlslens'
Plug 'windwp/nvim-ts-autotag'
Plug 'hrsh7th/cmp-path'
Plug 'L3MON4D3/LuaSnip', {'tag': '*'}
Plug 'saadparwaiz1/cmp_luasnip'
Plug 'lambdalisue/suda.vim'
Plug 'akinsho/bufferline.nvim', { 'tag': '*' }
Plug 'gorbit99/codewindow.nvim'
2022-10-05 19:22:26 +00:00
Plug 'preservim/nerdcommenter'
Plug 'rmagatti/auto-session'
2022-10-06 12:01:05 +00:00
Plug 'tpope/vim-fugitive'
Plug 'Glench/Vim-Jinja2-Syntax'
Plug 'vmware-archive/salt-vim'
Plug 'nvim-lualine/lualine.nvim'
Plug 'itchyny/vim-cursorword'
Plug 'sheerun/vim-polyglot'
2022-10-10 17:35:17 +00:00
" themes
Plug 'navarasu/onedark.nvim'
Plug 'ellisonleao/gruvbox.nvim'
Plug 'dracula/vim'
Plug 'vigoux/oak'
Plug 'NLKNguyen/papercolor-theme'
Plug 'bluz71/vim-moonfly-colors'
2022-10-05 19:22:26 +00:00
"Fuzzy search by Telescope and its dependencies:
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' }
2022-10-05 19:22:26 +00:00
Plug 'BurntSushi/ripgrep'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
2022-10-05 19:22:26 +00:00
call plug#end()
2022-10-21 08:53:31 +00:00
" set termguicolors before lua config,
" as it can contain some theme stuff that
" checks for termguicolors
set termguicolors
2022-10-09 15:35:20 +00:00
" load main lua file with additional configs
lua require("general")
lua require("my-lspconfig")
lua require("my-lint")
2022-10-05 19:22:26 +00:00
2022-10-19 13:11:04 +00:00
" highlight all .conf files as apache config (:])
2022-10-14 07:03:27 +00:00
autocmd BufEnter *.conf :setlocal filetype=apache
2022-10-06 12:01:05 +00:00
"nerdtree bindings
nnoremap <leader>n :NvimTreeFocus<CR>
nnoremap <C-t> :NvimTreeToggle<CR>
2022-10-05 19:22:26 +00:00
" nerdcommenter custom bindings
2022-12-03 18:41:39 +00:00
nmap <c-/> <plug>NERDCommenterToggle
vmap <c-/> <plug>NERDCommenterToggle
2022-10-05 19:22:26 +00:00
"theme configuration
2022-10-05 19:22:26 +00:00
syntax enable
let g:onedark_config = {
\ 'style': 'darker',
\}
let g:PaperColor_Theme_Options = {
\ 'language': {
\ 'python': {
\ 'highlight_builtins' : 1
\ },
\ 'cpp': {
\ 'highlight_standard_library': 1
\ },
\ 'c': {
\ 'highlight_builtins' : 1
\ }
\ }
\ }
colorscheme moonfly
2022-10-05 19:22:26 +00:00
set splitright
set splitbelow
" indent/unindent with tab/shift-tab
nmap <Tab> >>
nmap <S-tab> <<
imap <S-Tab> <Esc><<i
vmap <Tab> >gv
vmap <S-Tab> <gv
" Find files using Telescope command-line sugar.
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" gitgutter setup
let g:gitgutter_sign_added = '|'
let g:gitgutter_sign_modified = '|'
let g:gitgutter_sign_removed = '|'
let g:gitgutter_sign_removed_first_line = '|'
let g:gitgutter_sign_removed_above_and_below = '|'
let g:gitgutter_sign_modified_removed = '|'
let g:gitgutter_preview_win_floating = 1
nnoremap <C-g> <cmd>GitGutterPreviewHunk<cr>
2022-10-05 19:22:26 +00:00
" general configs
set modeline
let g:sls_use_jinja_syntax = 1
2022-10-06 12:01:05 +00:00
set encoding=UTF-8
2022-10-21 08:53:31 +00:00
set showmatch " show matching
set ignorecase " case insensitive
set mouse=v " middle-click paste with
set hlsearch " highlight search
2022-10-05 19:22:26 +00:00
set incsearch " incremental search
2022-10-21 08:53:31 +00:00
set tabstop=4 " number of columns occupied by a tab
2022-10-05 19:22:26 +00:00
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
set expandtab " converts tabs to white space
set shiftwidth=4 " width for autoindents
set autoindent " indent a new line the same amount as the line just typed
set number " add line numbers
set relativenumber " add relative line numbers
2022-10-05 19:22:26 +00:00
set wildmode=longest,list " get bash-like tab completions
2022-10-10 05:23:47 +00:00
set cc=80 " set an 80 column border for good coding style
2022-10-05 19:22:26 +00:00
filetype plugin indent on "allow auto-indenting depending on file type
syntax on " syntax highlighting
2022-10-10 05:23:47 +00:00
"set mouse=a " enable mouse click
set clipboard+=unnamedplus " using system clipboard
2022-10-05 19:22:26 +00:00
filetype plugin on
set cursorline " highlight current cursorline
set ttyfast " Speed up scrolling in Vim
" set spell " enable spell check (may need to download language package)
2022-10-10 05:23:47 +00:00
set noswapfile " disable creating swap file
2022-10-05 19:22:26 +00:00
" set backupdir=~/.cache/vim " Directory to store backup files.