Minor updates

This commit is contained in:
Kristofers Solo 2022-08-02 23:16:35 +03:00
parent 2a7c51f3ae
commit b319945989
14 changed files with 107 additions and 2837 deletions

View File

@ -54,7 +54,7 @@ update_ms = 1000
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
proc_sorting = "memory"
proc_sorting = "cpu direct"
#* Reverse sorting order, True or False.
proc_reversed = False

View File

@ -13,13 +13,13 @@ dashboard.section.header.val = {
[[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
}
dashboard.section.buttons.val = {
dashboard.button("f", " Find file", ":Telescope find_files <CR>"),
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
dashboard.button("p", " Find project", ":Telescope projects <CR>"),
dashboard.button("r", " Recently used files", ":Telescope oldfiles <CR>"),
dashboard.button("t", " Find text", ":Telescope live_grep <CR>"),
dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua <CR>"),
dashboard.button("q", " Quit Neovim", ":qa<CR>"),
dashboard.button("f", " Find file", "<cmd>Telescope find_files hidden=true<CR>"),
dashboard.button("e", " New file", "<cmd>ene <BAR> startinsert hidden=true<CR>"),
dashboard.button("p", " Find project", "<cmd>Telescope projects<CR>"),
dashboard.button("r", " Recently used files", "<cmd>Telescope oldfiles<CR>"),
dashboard.button("t", " Find text", "<cmd>Telescope live_grep hidden=true<CR>"),
dashboard.button("c", " Configuration", "<cmd>e ~/.config/nvim/init.lua<CR>"),
dashboard.button("q", " Quit Neovim", "<cmd>qa<CR>"),
}
local function footer()

View File

@ -12,7 +12,7 @@ gitsigns.setup({
changedelete = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
},
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {

View File

@ -7,6 +7,9 @@ keymap("", "<Space>", "<Nop>", opts)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- Remmove default keymaps
keymap("n", "<S-j>", "<Nop>", opts)
-- Modes
-- normal_mode = 'n',
-- insert_mode = 'i',
@ -17,14 +20,14 @@ vim.g.maplocalleader = " "
-- Normal --
-- Shortcutting split navigation
keymap("n", "<C-l>", "<C-w>l", opts)
keymap("n", "<C-h>", "<C-w>h", opts)
keymap("n", "<C-j>", "<C-w>j", opts)
keymap("n", "<C-k>", "<C-w>k", opts)
keymap("n", "<C-l>", "<C-w>l", opts)
-- Resize with arrows
keymap("n", "<C-Up>", "<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-Left>", "<cmd>vertical resize -2<CR>", opts)
keymap("n", "<C-Right>", "<cmd>vertical resize +2<CR>", opts)
@ -32,34 +35,38 @@ keymap("n", "<C-Right>", "<cmd>vertical resize +2<CR>", opts)
keymap("n", "<S-l>", "<cmd>bnext<CR>", opts)
keymap("n", "<S-h>", "<cmd>bprevious<CR>", opts)
-- Move text up and down
keymap("n", "<A-j>", "<Esc><cmd>m .+1<CR>", opts)
keymap("n", "<A-k>", "<Esc><cmd>m .-2<CR>", opts)
-- Move text up and down.
keymap("n", "<A-k>", "<cmd>m .-2<CR>==", opts)
keymap("n", "<A-j>", "<cmd>m .+1<CR>==", opts)
-- Insert --
-- Press jk fast to exit insert mode
keymap("i", "jk", "<ESC>", opts)
keymap("i", "jk", "<Esc>", opts)
-- Visual --
-- Stay in indent mode
keymap("v", "<", "<gv", opts)
keymap("v", ">", ">gv", opts)
-- Move text up and down
keymap("v", "<A-j>", "<cmd>m .+1<CR>", opts)
keymap("v", "<A-k>", "<cmd>m .-2<CR>", opts)
keymap("v", "p", '"_dP', opts)
-- Move text up and down. Visual mode
-- keymap("v", "<A-j>", "<cmd>m '>+1<CR>gv=gv", opts)
-- keymap("v", "<A-k>", "<cmd>m '<-2<CR>gv=gv", opts)
keymap("v", "p", "'_dP'", opts)
-- Visual Block --
-- Move text up and down
keymap("x", "J", '<cmd>move ">+1<CR>gv-gv', opts)
keymap("x", "K", '<cmd>move "<-2<CR>gv-gv', opts)
keymap("x", "<A-j>", '<cmd>move ">+1<CR>gv-gv', opts)
keymap("x", "<A-k>", '<cmd>move "<-2<CR>gv-gv', opts)
-- Move text up and down.
-- keymap("x", "K", "<cmd>m '>+1<CR>gv=gv", opts)
-- keymap("x", "J", "<cmd>m '<-2<CR>gv=gv", opts)
-- keymap("x", "<A-k>", "<cmd>m '<-2<CR>gv=gv", opts)
-- keymap("x", "<A-j>", "<cmd>m '>+1<CR>gv=gv", opts)
-- Terminal --
-- Better terminal navigation
-- keymap('t', '<C-h>', '<C-\\><C-N><C-w>h', term_opts)
-- keymap('t', '<C-j>', '<C-\\><C-N><C-w>j', term_opts)
-- keymap('t', '<C-k>', '<C-\\><C-N><C-w>k', term_opts)
-- keymap('t', '<C-l>', '<C-\\><C-N><C-w>l', term_opts)
keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", term_opts)
keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", term_opts)
keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", term_opts)
keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts)
-- Shortcutting --
-- Substitute
keymap("n", "C-f", ":%s//<Left>", {})

View File

@ -5,7 +5,7 @@ end
local lspconfig = require("lspconfig")
local servers = { "jsonls", "sumneko_lua", "pyright" }
local servers = { "jsonls", "sumneko_lua", "pyright", "rust_analyzer" }
lsp_installer.setup({
ensure_installed = servers,

View File

@ -0,0 +1,15 @@
return {
settings = {
["rust_analyzer"] = {
cargo = {
loadOutDirsFromCheck = true,
},
checkOnSave = {
command = "clippy",
},
experimental = {
procAttrMacros = true,
},
},
},
}

View File

@ -7,7 +7,7 @@ g.maplocalleader = " "
local options = {
backup = false, -- creates a backup file
clipboard = "unnamedplus", -- allows neovim to access the system clipboard
cmdheight = 2, -- more space in the neovim command line for displaying messages
cmdheight = 1, -- more space in the neovim command line for displaying messages
completeopt = { "menu", "menuone", "noselect" }, -- mostly just for cmp
conceallevel = 0, -- so that `` is visible in markdown files
fileencoding = "utf-8", -- the encoding written to a file
@ -21,7 +21,7 @@ local options = {
smartindent = true, -- make indenting smarter again
splitbelow = true, -- force all horizontal splits to go below current window
splitright = true, -- force all vertical splits to go to the right of current window
swapfile = true, -- creates a swapfile
swapfile = false, -- creates a swapfile
termguicolors = true, -- set term gui colors (most terminals support this)
timeoutlen = 100, -- time to wait for a mapped sequence to complete (in milliseconds)
undofile = true, -- enable persistent undo
@ -34,9 +34,9 @@ local options = {
cursorcolumn = true, -- highlight the current column
number = true, -- set numbered lines
relativenumber = true, -- set relative numbered lines
numberwidth = 4, -- set number column width to 4 {default 4}
numberwidth = 2, -- set number column width to 2 {default 4}
signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time
wrap = false, -- display lines as one long line
wrap = true, -- display lines as one long line
scrolloff = 8, -- is one of my fav
sidescrolloff = 8,
--wildmode = 'longest,list,full',
@ -47,9 +47,6 @@ for k, v in pairs(options) do
vim.opt[k] = v
end
vim.cmd([[highlight CursorLine ctermbg=Yellow cterm=bold guibg=#2b2b2b]])
vim.cmd([[highlight CursorColumn ctermbg=Yellow cterm=bold guibg=#2b2b2b]])
g.dracula_transparent_bg = true
g.dracula_italic_comment = true
g.dracula_show_end_of_buffer = true

View File

@ -1,5 +1,5 @@
local api = vim.api
local status_ok, toggleterm = pcall(require, 'toggleterm')
local status_ok, toggleterm = pcall(require, "toggleterm")
if not status_ok then
return
end
@ -14,57 +14,57 @@ toggleterm.setup({
start_in_insert = true,
insert_mappings = true,
persist_size = true,
direction = 'float',
direction = "float",
close_on_exit = true,
shell = vim.o.shell,
float_opts = {
border = 'curved',
border = "curved",
winblend = 0,
highlights = {
border = 'Normal',
background = 'Normal',
border = "Normal",
background = "Normal",
},
},
})
function _G.set_terminal_keymaps()
local opts = { noremap = true }
api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
api.nvim_buf_set_keymap(0, 't', 'jk', [[<C-\><C-n>]], opts)
api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
api.nvim_buf_set_keymap(0, "t", "<esc>", [[<C-\><C-n>]], opts)
api.nvim_buf_set_keymap(0, "t", "jk", [[<C-\><C-n>]], opts)
api.nvim_buf_set_keymap(0, "t", "<C-h>", [[<C-\><C-n><C-W>h]], opts)
api.nvim_buf_set_keymap(0, "t", "<C-j>", [[<C-\><C-n><C-W>j]], opts)
api.nvim_buf_set_keymap(0, "t", "<C-k>", [[<C-\><C-n><C-W>k]], opts)
api.nvim_buf_set_keymap(0, "t", "<C-l>", [[<C-\><C-n><C-W>l]], opts)
end
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
local Terminal = require('toggleterm.terminal').Terminal
local lazygit = Terminal:new({ cmd = 'lazygit', hidden = true })
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
function _LAZYGIT_TOGGLE()
lazygit:toggle()
end
local node = Terminal:new({ cmd = 'node', hidden = true })
local node = Terminal:new({ cmd = "node", hidden = true })
function _NODE_TOGGLE()
node:toggle()
end
local ncdu = Terminal:new({ cmd = 'ncdu', hidden = true })
local ncdu = Terminal:new({ cmd = "ncdu", hidden = true })
function _NCDU_TOGGLE()
ncdu:toggle()
end
local btop = Terminal:new({ cmd = 'btop', hidden = true })
local btop = Terminal:new({ cmd = "btop", hidden = true })
function _BTOP_TOGGLE()
btop:toggle()
end
local python = Terminal:new({ cmd = 'python', hidden = true })
local python = Terminal:new({ cmd = "python", hidden = true })
function _PYTHON_TOGGLE()
python:toggle()

View File

@ -13,6 +13,9 @@ configs.setup({
autopairs = {
enable = true,
},
autotag = {
enable = true,
},
indent = { enable = true, disable = { "yaml" } },
rainbow = {
enable = true,

View File

@ -161,7 +161,6 @@ local mappings = {
},
s = {
name = "Search",
s = { "<cmd>s%//<Left>", "Replace word" },
b = { "<cmd>Telescope git_branches<CR>", "Checkout branch" },
c = { "<cmd>Telescope colorscheme<CR>", "Colorscheme" },
h = { "<cmd>Telescope help_tags<CR>", "Find Help" },
@ -176,7 +175,7 @@ local mappings = {
name = "Terminal",
n = { "<cmd>lua _NODE_TOGGLE()<CR>", "Node" },
u = { "<cmd>lua _NCDU_TOGGLE()<CR>", "NCDU" },
t = { "<cmd>lua _BTOP_TOGGLE()<CR>", "Btop" },
b = { "<cmd>lua _BTOP_TOGGLE()<CR>", "Btop" },
p = { "<cmd>lua _PYTHON_TOGGLE()<CR>", "Python" },
f = { "<cmd>ToggleTerm direction=float<CR>", "Float" },
h = { "<cmd>ToggleTerm size=10 direction=horizontal<CR>", "Horizontal" },
@ -186,7 +185,9 @@ local mappings = {
name = "Settings",
c = { "<cmd>setlocal formatoptions-=cro<CR>", "Disable autocomment" },
C = { "<cmd>setlocal formatoptions=cro<CR>", "Enable autocomment" },
s = { "<cmd>setlocal spell! spelllang=en_us<CR>", "Toggle spellchecker" },
s = { "<cmd>setlocal spell!<CR>", "Toggle spellchecker" },
e = { "<cmd>setlocal spell spelllang=en_us<CR>", "Enable English spellchecker" },
l = { "<cmd>setlocal spell spelllang=lv_LV<CR>", "Enable Lavian spellchecker" },
I = { "<cmd>setlocal autoindent<CR>", "Enable autoindent" },
i = { "<cmd>setlocal noautoindent<CR>", "Disable autoindent" },
},

View File

@ -46,4 +46,5 @@ alias \
weather="curl wttr.in/" \
ww="$EDITOR ~/vimwiki/index.wiki" \
day="redshift -PO 6500" \
night="redshift -PO 4500"
night="redshift -PO 4500" \
z="zathura"

View File

@ -15,5 +15,5 @@ disabled = true
[cmd_duration]
min_time = 0
show_milliseconds = true
show_milliseconds = false
format = "took [$duration](bold yellow)"

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,6 @@ WORDCHARS=${WORDCHARS//\/[&.;]/} # Don't consider certain part of the word
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null
source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh 2>/dev/null
zmodload zsh/terminfo
eval "$(lua ~/.config/zlua/z.lua --init zsh)"
# Keybindings
bindkey -e
@ -119,7 +118,7 @@ bindkey -M vicmd '^[[P' vi-delete-char
bindkey -M vicmd '^e' edit-command-line
bindkey -M visual '^[[P' vi-delete
bindkey -s '^n' '^uv .\n'
bindkey -s '^n' '^uv\n'
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh 2>/dev/null