From 35d7673e0b62a72a44271149c92f29ea0cc7b8ee Mon Sep 17 00:00:00 2001 From: Kumar Damani Date: Thu, 14 Jul 2022 12:51:09 -0400 Subject: update gitignore --- nvim/.config/nvim/init.vim | 44 ++++++++++++++----------------- nvim/.config/nvim/lua/kdam0/commenter.lua | 4 +-- nvim/.config/nvim/lua/kdam0/lspconfig.lua | 2 +- 3 files changed, 23 insertions(+), 27 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 3ef11bf..030d078 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -1,4 +1,4 @@ -" --- General +" General let mapleader = "," @@ -31,21 +31,22 @@ set encoding=UTF-8 set pastetoggle=v set showbreak=↪\ set listchars=tab:→\ ,eol:↲,nbsp:␣,trail:•,extends:⟩,precedes:⟨ +set background=dark + +" Plugins -" auto-install vim-plug +" Auto-install vim-plug if empty(glob('~/.config/nvim/autoload/plug.vim')) silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall endif - -" --- Plugins +" Enable plugins call plug#begin('~/.config/nvim/autoload/plugged') " General Plug 'folke/tokyonight.nvim', { 'branch': 'main' } Plug 'mcchrish/nnn.vim' Plug 'lukas-reineke/indent-blankline.nvim' - " Lsp Plug 'neovim/nvim-lspconfig' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} @@ -65,16 +66,15 @@ Plug 'danymat/neogen' Plug 'numToStr/Comment.nvim' " Lsp w/ auto pairs Plug 'windwp/nvim-autopairs' - " Telescope Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } call plug#end() - +" Source plugin configs. lua require('kdam0') -" nnn +" n³ let g:nnn#layout = { 'window': { 'width': 0.9, 'height': 0.6, 'highlight': 'Debug' } } let g:nnn#action = { \ '': 'tab split', @@ -82,14 +82,14 @@ let g:nnn#action = { \ '': 'vsplit' } let g:nnn#set_default_mappings = 0 -" --- Colors +" Colors -set background=dark colorscheme tokyonight +" Fileype specific settings + " Automatically deletes all tralling whitespace on save. autocmd BufWritePre * %s/\s\+$//e - " Tab settings autocmd Filetype css setlocal tabstop=2 autocmd FileType yml setlocal ai ts=2 sw=2 et @@ -99,30 +99,26 @@ autocmd FileType jinja setlocal ai ts=2 sw=2 et autocmd FileType python setlocal ai ts=4 sw=4 et autocmd FileType make setlocal noexpandtab -" --- Remaps +" Remaps + " Save nmap , :w -" C-T for new tab buffer +" New tab nnoremap :tabnew -" For normal mode when in terminals (in X I have caps mapped to esc, this replaces it when I don't have X) +" Exit Normal mode inoremap jk -"Shortcutting split navigation, saving a keypress: -map h -map j -map k -map l -" Spell-check set to F6: +" Spell-check map :setlocal spell! spelllang=en_ca -"Replace all is aliased to S. +" Replace all is aliased to S. nnoremap S :%s//g vnoremap S noop vnoremap S :s//g -" indent blocks in visual mode. +" Indent blocks in visual mode. vnoremap K xkP`[V`] vnoremap J xp`[V`] vnoremap L >gv vnoremap H l :set list! " Snippets jumping imap luasnip#expand_or_jumpable() ? 'luasnip-expand-or-jump' : '' @@ -134,5 +130,5 @@ nnoremap d lua require('neogen').generate() nnoremap dc lua require('neogen').generate({ type = 'class' }) nnoremap df lua require('neogen').generate({ type = 'file' }) nnoremap dt lua require('neogen').generate({ type = 'type' }) -" Start n³ in the current file's directory +" Start n³ in the current buffers directory nnoremap n :NnnPicker %:p:h diff --git a/nvim/.config/nvim/lua/kdam0/commenter.lua b/nvim/.config/nvim/lua/kdam0/commenter.lua index fead874..b326d2b 100644 --- a/nvim/.config/nvim/lua/kdam0/commenter.lua +++ b/nvim/.config/nvim/lua/kdam0/commenter.lua @@ -3,8 +3,8 @@ require('Comment').setup{ sticky = true, ignore = nil, toggler = { - line = 'c', - block = 'b', + line = 'cc', + block = 'cb', }, opleader = { line = 'c', diff --git a/nvim/.config/nvim/lua/kdam0/lspconfig.lua b/nvim/.config/nvim/lua/kdam0/lspconfig.lua index 819b9ea..1adda04 100644 --- a/nvim/.config/nvim/lua/kdam0/lspconfig.lua +++ b/nvim/.config/nvim/lua/kdam0/lspconfig.lua @@ -91,7 +91,7 @@ settings = { bashls = {} } -local servers = {'pylsp', 'bashls', 'jsonls'} +local servers = {'ansiblels', 'dockerls', 'pylsp', 'bashls', 'jsonls'} for _,lsp in ipairs(servers) do lspconfig[lsp].setup{ on_attach = on_attach, -- cgit v1.2.3