aboutsummaryrefslogtreecommitdiff
path: root/nvim
diff options
context:
space:
mode:
Diffstat (limited to 'nvim')
-rw-r--r--nvim/.config/nvim/init.vim44
-rw-r--r--nvim/.config/nvim/lua/kdam0/commenter.lua4
-rw-r--r--nvim/.config/nvim/lua/kdam0/lspconfig.lua2
3 files changed, 23 insertions, 27 deletions
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=<Leader>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 = {
\ '<c-t>': 'tab split',
@@ -82,14 +82,14 @@ let g:nnn#action = {
\ '<c-v>': '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 <Leader>, :w<cr>
-" C-T for new tab buffer
+" New tab
nnoremap <C-t> :tabnew<cr>
-" 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 <Esc>
-"Shortcutting split navigation, saving a keypress:
-map <C-h> <C-w>h
-map <C-j> <C-w>j
-map <C-k> <C-w>k
-map <C-l> <C-w>l
-" Spell-check set to F6:
+" Spell-check
map <F6> :setlocal spell! spelllang=en_ca<CR>
-"Replace all is aliased to S.
+" Replace all is aliased to S.
nnoremap S :%s//g<Left><Left>
vnoremap S noop
vnoremap S :s//g<Left><Left>
-" indent blocks in visual mode.
+" Indent blocks in visual mode.
vnoremap K xkP`[V`]
vnoremap J xp`[V`]
vnoremap L >gv
vnoremap H <gv
-" toggle line chars view
+" Toggle line chars view
noremap <Leader>l :set list!<CR>
" Snippets jumping
imap <silent><expr> <c-j> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<c-j>'
@@ -134,5 +130,5 @@ nnoremap <silent> <Leader>d <cmd>lua require('neogen').generate()<Cr>
nnoremap <silent> <Leader>dc <cmd>lua require('neogen').generate({ type = 'class' })<CR>
nnoremap <silent> <Leader>df <cmd>lua require('neogen').generate({ type = 'file' })<CR>
nnoremap <silent> <Leader>dt <cmd>lua require('neogen').generate({ type = 'type' })<CR>
-" Start n³ in the current file's directory
+" Start n³ in the current buffers directory
nnoremap <Leader>n :NnnPicker %:p:h<CR>
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 = '<Leader>c',
- block = '<Leader>b',
+ line = '<Leader>cc',
+ block = '<Leader>cb',
},
opleader = {
line = '<Leader>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,