new nvim config; some fixes

This commit is contained in:
Agatha Lovelace 2022-05-11 16:14:46 +02:00
parent 6baf6651ca
commit a9815d3f5b
Signed by: sorceress
GPG Key ID: 11BBCFC65FC9F401
4 changed files with 238 additions and 28 deletions

151
.config/nvim/init.vim Normal file
View File

@ -0,0 +1,151 @@
" __
" / -,
" || ) ; '
" ~||---) _-_ /'\\ \\/\ \\ \\/\\/\\
" ~||---, || \\ || || || | || || || ||
" ~|| / ||/ || || || | || || || ||
" |, / \\,/ \\,/ \\/ \\ \\ \\ \\
" -_- --~
"
" import .vimrc
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
" colors
highlight Pmenu guibg=black
" refresh time
set updatetime=500
" keybinds
" code actions
nnoremap <C-c><C-a> :lua vim.lsp.buf.code_action()<CR>
" ale
let g:ale_linters = {'rust': ['analyzer']}
let g:ale_rust_analyzer_config = {
\ 'cargo': { 'loadOutDirsFromCheck': v:true },
\ 'procMacro': { 'enable': v:true },
\ 'checkOnSave': { 'command': 'clippy', 'enable': v:true }
\ }
let g:lightline.component_expand = {
\ 'linter_checking': 'lightline#ale#checking',
\ 'linter_infos': 'lightline#ale#infos',
\ 'linter_warnings': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok',
\ }
let g:lightline.component_function = {
\ 'gitbranch': 'FugitiveHead'
\ }
let g:lightline.component_type = {
\ 'linter_checking': 'right',
\ 'linter_infos': 'right',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error',
\ 'linter_ok': 'right',
\ }
" lightline symbols
let g:lightline#ale#indicator_checking = "\uf110"
let g:lightline#ale#indicator_infos = "\uf129"
let g:lightline#ale#indicator_warnings = "\uf071"
let g:lightline#ale#indicator_errors = "\uf05e"
let g:lightline#ale#indicator_ok = "\uf00c"
" lightline modules
let g:lightline.active = {
\ 'left' : [
\ ['mode', 'paste'],
\ ['gitbranch', 'readonly', 'filename', 'modified']
\ ],
\ 'right': [
\ ['linter_checking', 'linter_errors', 'linter_warnings'],
\ ['lineinfo'],
\ ['percent'],
\ ['fileformat', 'fileencoding', 'filetype']
\ ]
\}
lua << EOF
-- cursor animations
require('specs').setup{
show_jumps = true,
min_jump = 30,
popup = {
delay_ms = 100, -- delay before popup displays
inc_ms = 20, -- time increments used for fade/resize effects
blend = 10, -- starting blend, between 0-100 (fully transparent), see :h winblend
width = 10,
winhl = "PMenu",
fader = require('specs').exp_fader,
resizer = require('specs').shrink_resizer
},
ignore_buftypes = {
nofile = true,
},
}
-- lsp config
local nvim_lsp = require 'lspconfig'
local cmp = require'cmp'
nvim_lsp.rust_analyzer.setup({})
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
require('lspconfig')['rust_analyzer'].setup {
capabilities = capabilities
}
vim.diagnostic.config({
virtual_text = {
prefix = ''
},
signs = false
})
-- complations
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' },
{ name = 'calc' },
}, {
{ name = 'buffer' },
})
})
require("todo-comments").setup {}
-- loading status
require"fidget".setup{
text = {
spinner = "star"
}
}
require'nvim-web-devicons'.setup {
}
EOF

View File

@ -52,10 +52,11 @@ font-0 = DaddyTimeMono:pixelsize=10;3
font-1 = unifont:fontformat=truetype:size=8:antialias=false;2
font-2 = Siji:pixelsize=11;2
font-3 = Symbols Nerd Font:pixelsize=10;2
font-4 = unifont:fontformat=truetype:size=8:antialias=false;1
modules-left = bspwm
modules-center = date
modules-right = filesystem battery pulseaudio xkeyboard memory cpu powermenu
modules-right = filesystem battery pulseaudio xkeyboard vpn-wireguard-wg memory cpu powermenu
wm-restack = bspwm
@ -207,7 +208,7 @@ label-volume-foreground = ${root.foreground}
label-muted =  muted
label-muted-foreground = #666
bar-volume-width = 25
bar-volume-width = 14
bar-volume-foreground-0 = #55aa55
bar-volume-foreground-1 = #55aa55
bar-volume-foreground-2 = #55aa55
@ -217,10 +218,10 @@ bar-volume-foreground-5 = #f5a70a
bar-volume-foreground-6 = #ff5555
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = -
bar-volume-indicator-font = 5
bar-volume-fill =
bar-volume-fill-font = 2
bar-volume-empty = -
bar-volume-empty =
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
@ -364,6 +365,13 @@ exec = ~/.config/polybar/scripts/mullvad-status.sh | sed 's/VPN disconnected//g'
interval = 2
format-prefix = " "
[module/vpn-wireguard-wg]
type = custom/script
exec = ~/.config/polybar/scripts/vpn-wireguard-wg.sh
interval = 5
click-left = kitty nmtui
format-prefix = " "
[module/notification-status]
type = custom/script
exec = ~/.config/polybar/scripts/notification-status.sh

View File

@ -36,13 +36,17 @@ super + slash
# open clipboard
alt + v
CM_LAUNCHER=rofi clipmenu \
-theme-str 'listview \{ spacing: 0; \}' \
-theme-str 'window \{ width: 30em; \}'
CM_LAUNCHER=rofi clipmenu \
-theme-str 'listview \{ spacing: 0; \}' \
-theme-str 'window \{ width: 30em; \}'
# open calculator
alt + c
rofi -show calc -modi calc -calc-command 'xdotool type --clearmodifiers "\{result\}"'
rofi -show calc -modi calc -calc-command 'xdotool type --clearmodifiers "\{result\}"'
# kill program
super + shift + x
kill -9 $(ps --sort=-pcpu -ax | rofi -dmenu | choose 0 )
# open a terminal emulator
Caps_Lock
@ -204,3 +208,8 @@ super + r
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
# lock screen
super + x
betterlockscreen --lock dimblur

76
.vimrc
View File

@ -9,44 +9,77 @@
" Load plugins
call plug#begin('~/.vim/bundle')
Plug 'aliva/vim-fish'
Plug 'aliva/vim-fish', {'for': 'fish'}
Plug 'cocopon/iceberg.vim'
Plug 'dhruvasagar/vim-table-mode'
Plug 'fadein/vim-FIGlet'
Plug 'gkeep/iceberg-dark'
Plug 'itchyny/lightline.vim'
Plug 'karolbelina/uxntal.vim'
Plug 'lambdalisue/fern-renderer-nerdfont.vim'
Plug 'lambdalisue/fern.vim'
Plug 'lambdalisue/nerdfont.vim'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'karolbelina/uxntal.vim', {'for': 'uxntal'}
Plug 'lilydjwg/colorizer'
Plug 'mg979/vim-visual-multi'
Plug 'owickstrom/vim-colors-paramount'
Plug 'raimondi/delimitmate'
Plug 'tpope/vim-commentary'
Plug 'vim-scripts/nginx.vim'
Plug 'vim-scripts/nginx.vim', {'for': 'nginx'}
Plug 'yuttie/comfortable-motion.vim'
call plug#end()
Plug 'ryanoasis/vim-devicons'
" don't install these plugins on remote servers
if has('nvim')
Plug 'folke/todo-comments.nvim'
Plug 'hrsh7th/cmp-calc'
Plug 'j-hui/fidget.nvim'
Plug 'jghauser/mkdir.nvim'
Plug 'stevearc/dressing.nvim'
Plug 'airblade/vim-gitgutter'
Plug 'antoinemadec/FixCursorHold.nvim'
Plug 'edluffy/specs.nvim'
Plug 'folke/lsp-colors.nvim'
Plug 'folke/trouble.nvim'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-vsnip'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/vim-vsnip'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'maximbaz/lightline-ale'
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'tpope/vim-fugitive'
Plug 'w0rp/ale'
Plug 'xuyuanp/nerdtree-git-plugin'
endif
call plug#end()
" Lightline config
let g:lightline = {
\ 'colorscheme': 'icebergDark',
\ }
" Fern config
let g:fern#renderer = "nerdfont"
" Comfortable Motion config
noremap <silent> <ScrollWheelDown> :call comfortable_motion#flick(20)<CR>
noremap <silent> <ScrollWheelUp> :call comfortable_motion#flick(-20)<CR>
" VM config
let g:VM_maps = {}
let g:VM_maps["I BS"] = '<c-BS>'
" Nerdtree/git config
let g:NERDTreeGitStatusConcealBrackets = 1
" Aliases
command Header FIGlet -f Gothic
cmap W w !sudo tee > /dev/null %
nnoremap <C-n> :NERDTreeToggle<CR>
nnoremap <C-e> :NERDTreeTabsToggle<CR>
" Colorscheme
set background=dark
@ -55,18 +88,19 @@ colorscheme paramount
let bgcolor = synIDattr(hlID("Normal"), "bg")
let fgcolor = synIDattr(hlID("Identifier"), "fg")
let colors = "\033]11;" . fgcolor . "\007\033]11;" . bgcolor . "\007"
if has('gui_running') || has('nvim')
hi Normal guifg=fgcolor guibg=bgcolor
autocmd VimEnter * call chansend(v:stderr, colors)
autocmd VimLeave * call chansend(v:stderr, "\033]110\007\033]111\007")
else
" Set the terminal default background and foreground colors, thereby
" improving performance by not needing to set these colors on empty cells.
hi Normal guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE
let &t_ti = &t_ti . "\033]10;" . fgcolor . "\007\033]11;" . bgcolor . "\007"
let &t_ti = &t_ti . colors
let &t_te = &t_te . "\033]110\007\033]111\007"
endif
" Vanilla config
syntax on
filetype plugin indent on
@ -75,12 +109,16 @@ set number
set wrap
set mouse=a
set softtabstop=4 noexpandtab
set ts=4 sw=4
set autoindent
set smartindent
set laststatus=2
set noshowmode
set whichwrap+=<,>,h,l
" let &t_SI = "\<Esc>[6 q"
let &t_SI = "\<Esc>[6 q"
" let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"
@ -89,8 +127,12 @@ set clipboard=unnamedplus
nnoremap d "_d
vnoremap d "_d
set ignorecase
set smartcase
set hlsearch
let @/='' " fix search on startup
set encoding=utf-8
scriptencoding utf-8
setglobal fileencoding=utf-8
set ffs=unix,dos