Update 05.08.2022

This commit is contained in:
Kristofers Solo 2022-08-05 01:47:35 +03:00
parent 4b0b507cf5
commit a6f43d4374
4 changed files with 23 additions and 10 deletions

View File

@ -2,13 +2,16 @@ vim.cmd([[
augroup _general_settings augroup _general_settings
autocmd! autocmd!
autocmd FileType qf,help,man,lspinfo nnoremap <silent> <buffer> q :close<CR> autocmd FileType qf,help,man,lspinfo nnoremap <silent> <buffer> q :close<CR>
autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Visual', timeout = 200}) autocmd TextYankPost * silent!lua require("vim.highlight").on_yank({higroup = "Visual", timeout = 200})
autocmd BufWinEnter * :set formatoptions-=cro autocmd BufWinEnter * :set formatoptions-=cro
autocmd FileType qf set nobuflisted autocmd FileType qf set nobuflisted
" Remove following whitespaces
autocmd BufWritePre * %s/\s\+$//e autocmd BufWritePre * %s/\s\+$//e
" Center cursor on insert mode
autocmd InsertEnter * norm zz autocmd InsertEnter * norm zz
highlight CursorLine ctermbg=White cterm=bold guibg=#222222 highlight CursorLine ctermbg=White cterm=bold guibg=#222222
highlight CursorColumn ctermbg=White cterm=bold guibg=#222222 highlight CursorColumn ctermbg=White cterm=bold guibg=#222222
let g:vimwiki_list = [{'path': '~/vimwiki/', 'syntax': 'markdown', 'ext': '.md'}]
augroup end augroup end
augroup _git augroup _git
@ -40,9 +43,9 @@ vim.cmd([[
augroup _run augroup _run
autocmd! autocmd!
autocmd FileType python imap <buffer> <C-b> <esc><cmd>w<CR><cmd>exec '!python3' shellescape(@%, 1)<CR> autocmd FileType python imap <buffer> <C-b> <esc><cmd>w<CR><cmd>exec "!python3" shellescape(@%, 1)<CR>
autocmd FileType python map <buffer> <C-b> <cmd>w<CR><cmd>exec '!python3' shellescape(@%, 1)<CR> autocmd FileType python map <buffer> <C-b> <cmd>w<CR><cmd>exec "!python3" shellescape(@%, 1)<CR>
autocmd FileType rust imap <buffer> <C-b> <esc><cmd>w<CR><cmd>exec '!cargo run'<CR> autocmd FileType rust imap <buffer> <C-b> <esc><cmd>w<CR><cmd>exec "!cargo run"<CR>
autocmd FileType rust map <buffer> <C-b> <cmd>w<CR><cmd>exec '!cargo run'<CR> autocmd FileType rust map <buffer> <C-b> <cmd>w<CR><cmd>exec "!cargo run"<CR>
augroup end augroup end
]]) ]])

View File

@ -26,8 +26,8 @@ keymap("n", "<C-j>", "<C-w>j", opts)
keymap("n", "<C-k>", "<C-w>k", opts) keymap("n", "<C-k>", "<C-w>k", opts)
-- Resize with arrows -- Resize with arrows
keymap("n", "<C-Down>", "<cmd>resize +2<CR>", opts) keymap("n", "<C-Down>", "<cmd>resize -2<CR>", opts)
keymap("n", "<C-Up>", "<cmd>resize -2<CR>", opts) keymap("n", "<C-Up>", "<cmd>resize +2<CR>", opts)
keymap("n", "<C-Left>", "<cmd>vertical resize -2<CR>", opts) keymap("n", "<C-Left>", "<cmd>vertical resize -2<CR>", opts)
keymap("n", "<C-Right>", "<cmd>vertical resize +2<CR>", opts) keymap("n", "<C-Right>", "<cmd>vertical resize +2<CR>", opts)

View File

@ -85,8 +85,6 @@ local mappings = {
"Buffers", "Buffers",
}, },
["e"] = { "<cmd>NvimTreeToggle<CR>", "Explorer" }, ["e"] = { "<cmd>NvimTreeToggle<CR>", "Explorer" },
["w"] = { "<cmd>w!<CR>", "Save" },
["q"] = { "<cmd>q!<CR>", "Quit" },
["c"] = { "<cmd>Bdelete!<CR>", "Close Buffer" }, ["c"] = { "<cmd>Bdelete!<CR>", "Close Buffer" },
["h"] = { "<cmd>nohlsearch<CR>", "No Highlight" }, ["h"] = { "<cmd>nohlsearch<CR>", "No Highlight" },
["f"] = { ["f"] = {
@ -191,6 +189,18 @@ local mappings = {
I = { "<cmd>setlocal autoindent<CR>", "Enable autoindent" }, I = { "<cmd>setlocal autoindent<CR>", "Enable autoindent" },
i = { "<cmd>setlocal noautoindent<CR>", "Disable autoindent" }, i = { "<cmd>setlocal noautoindent<CR>", "Disable autoindent" },
}, },
w = {
name = "Vimwiki",
w = "<Plug>VimwikiIndex",
t = "<Plug>VimwikiTabIndex",
s = "<Plug>VimwikiUISelect",
i = "<Plug>VimwikiDiaryIndex",
h = "<Plug>Vimwiki2HTML",
H = "<Plug>Vimwiki2HTMLBrowse",
n = "<Plug>VimwikiGoto",
d = "<Plug>VimwikiDeleteFile",
r = "<Plug>VimwikiRenameFile",
},
} }
which_key.setup(setup) which_key.setup(setup)

View File

@ -45,7 +45,7 @@ alias \
airpods="bluetoothctl connect C8:B1:CD:E0:14:4F" \ airpods="bluetoothctl connect C8:B1:CD:E0:14:4F" \
lf="lfrun" \ lf="lfrun" \
weather="curl wttr.in/" \ weather="curl wttr.in/" \
ww="$EDITOR ~/vimwiki/index.wiki" \ ww="$EDITOR ~/vimwiki/index.md" \
day="redshift -PO 6500" \ day="redshift -PO 6500" \
night="redshift -PO 4500" \ night="redshift -PO 4500" \
z="zathura" z="zathura"