mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2024-11-05 15:16:23 +01:00
stuff
This commit is contained in:
parent
c8fb11a104
commit
8720084d17
|
@ -83,6 +83,7 @@ in with lib; {
|
||||||
# custom scripts
|
# custom scripts
|
||||||
window-screenshot desktop-ctl em-record em-play em-play-loop
|
window-screenshot desktop-ctl em-record em-play em-play-loop
|
||||||
pa_applet
|
pa_applet
|
||||||
|
brightnessctl
|
||||||
];
|
];
|
||||||
# i3 {{{
|
# i3 {{{
|
||||||
xsession = {
|
xsession = {
|
||||||
|
@ -178,6 +179,9 @@ in with lib; {
|
||||||
"XF86AudioPlay" = "exec playerctl play";
|
"XF86AudioPlay" = "exec playerctl play";
|
||||||
"XF86AudioStop" = "exec playerctl stop";
|
"XF86AudioStop" = "exec playerctl stop";
|
||||||
|
|
||||||
|
"XF86MonBrightnessUp" = "exec brightnessctl set 5%+";
|
||||||
|
"XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
|
||||||
|
|
||||||
# macros
|
# macros
|
||||||
"${mod}+q" = "exec em-record.sh";
|
"${mod}+q" = "exec em-record.sh";
|
||||||
"${mod}+p" = "exec em-play.sh";
|
"${mod}+p" = "exec em-play.sh";
|
||||||
|
|
|
@ -54,9 +54,11 @@ in with lib; {
|
||||||
coc = {
|
coc = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
rust-analyzer.server.path = "${pkgs.rust-analyzer.outPath}/bin/rust-analyzer";
|
rust-analyzer.server.path = "${pkgs.rust-analyzer}/bin/rust-analyzer";
|
||||||
};
|
};
|
||||||
pluginConfig = ''
|
pluginConfig = ''
|
||||||
|
let mapleader = "\<Space>"
|
||||||
|
|
||||||
nmap <silent> gd <Plug>(coc-definition)
|
nmap <silent> gd <Plug>(coc-definition)
|
||||||
nmap <silent> gy <Plug>(coc-type-definition)
|
nmap <silent> gy <Plug>(coc-type-definition)
|
||||||
nmap <silent> gi <Plug>(coc-implementation)
|
nmap <silent> gi <Plug>(coc-implementation)
|
||||||
|
@ -65,6 +67,56 @@ in with lib; {
|
||||||
nmap gr <Plug>(coc-rename)
|
nmap gr <Plug>(coc-rename)
|
||||||
nmap <leader>ac <Plug>(coc-codeaction)
|
nmap <leader>ac <Plug>(coc-codeaction)
|
||||||
nmap <leader>qf <Plug>(coc-fix-current)
|
nmap <leader>qf <Plug>(coc-fix-current)
|
||||||
|
|
||||||
|
|
||||||
|
" Use tab for trigger completion with characters ahead and navigate.
|
||||||
|
" NOTE: There's always complete item selected by default, you may want to enable
|
||||||
|
" no select by `"suggest.noselect": true` in your configuration file.
|
||||||
|
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
|
||||||
|
" other plugin before putting this into your config.
|
||||||
|
inoremap <silent><expr> <TAB>
|
||||||
|
\ coc#pum#visible() ? coc#pum#next(1) :
|
||||||
|
\ CheckBackspace() ? "\<Tab>" :
|
||||||
|
\ coc#refresh()
|
||||||
|
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
||||||
|
|
||||||
|
if has('nvim-0.4.0') || has('patch-8.2.0750')
|
||||||
|
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
|
||||||
|
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
|
||||||
|
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
|
||||||
|
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
|
||||||
|
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
|
||||||
|
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
" Make <CR> to accept selected completion item or notify coc.nvim to format
|
||||||
|
" <C-g>u breaks current undo, please make your own choice.
|
||||||
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
||||||
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||||
|
|
||||||
|
function! CheckBackspace() abort
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
|
endfunction
|
||||||
|
" Make <CR> to accept selected completion item or notify coc.nvim to format
|
||||||
|
" <C-g>u breaks current undo, please make your own choice.
|
||||||
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
||||||
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||||
|
|
||||||
|
function! CheckBackspace() abort
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~# '\s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Use <c-space> to trigger completion.
|
||||||
|
if has('nvim')
|
||||||
|
inoremap <silent><expr> <c-space> coc#refresh()
|
||||||
|
else
|
||||||
|
inoremap <silent><expr> <c-@> coc#refresh()
|
||||||
|
endif
|
||||||
|
|
||||||
|
nmap <leader>rn <Plug>(coc-rename)
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
# }}}
|
# }}}
|
||||||
|
@ -91,48 +143,6 @@ in with lib; {
|
||||||
set cindent
|
set cindent
|
||||||
set tabstop=4
|
set tabstop=4
|
||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
|
|
||||||
" Emacs Insert mode/command mode hotkeys {{{
|
|
||||||
" movement
|
|
||||||
inoremap <C-f> <Right>
|
|
||||||
inoremap <C-b> <Left>
|
|
||||||
inoremap <C-p> <Up>
|
|
||||||
inoremap <C-n> <Down>
|
|
||||||
cnoremap <C-f> <Right>
|
|
||||||
cnoremap <C-b> <Left>
|
|
||||||
cnoremap <C-p> <Up>
|
|
||||||
cnoremap <C-n> <Down>
|
|
||||||
|
|
||||||
inoremap <C-e> <C-o>$
|
|
||||||
inoremap <C-a> <C-o>_
|
|
||||||
cnoremap <C-e> <C-o>$
|
|
||||||
cnoremap <C-a> <C-o>_
|
|
||||||
|
|
||||||
inoremap <M-f> <C-Right>
|
|
||||||
inoremap <M-b> <C-Left>
|
|
||||||
inoremap <M-e> <C-o>)
|
|
||||||
inoremap <M-a> <C-o>(
|
|
||||||
cnoremap <M-f> <C-Right>
|
|
||||||
cnoremap <M-b> <C-Left>
|
|
||||||
cnoremap <M-e> <C-o>)
|
|
||||||
cnoremap <M-a> <C-o>(
|
|
||||||
|
|
||||||
inoremap <M-<> <Esc>ggi
|
|
||||||
inoremap <M->> <Esc>Gi
|
|
||||||
cnoremap <M-<> <Esc>ggi
|
|
||||||
cnoremap <M->> <Esc>Gi
|
|
||||||
|
|
||||||
" editing
|
|
||||||
inoremap <C-d> <Del>
|
|
||||||
inoremap <M-BS> <C-o>db
|
|
||||||
inoremap <M-d> <C-o>de
|
|
||||||
cnoremap <C-d> <Del>
|
|
||||||
cnoremap <M-BS> <C-o>db
|
|
||||||
cnoremap <M-d> <C-o>de
|
|
||||||
|
|
||||||
inoremap <C-s> <C-o>/
|
|
||||||
inoremap <C-r> <C-o>?
|
|
||||||
" }}}
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue