summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
-rw-r--r--.config/nvim/init.lua144
-rw-r--r--.config/shell/.zshrc1
-rw-r--r--.config/shell/envvarrc21
3 files changed, 121 insertions, 45 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index 289e1cd..f241c57 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -1,56 +1,91 @@
------------------------------------------------------------
--- General settings
+-- Filip's neovim config
------------------------------------------------------------
-vim.opt.number = true
+
+------------------------------------------------------------
+-- General / UI settings
+------------------------------------------------------------
+vim.opt.number = true
vim.opt.relativenumber = true
-vim.opt.title = true
-vim.opt.background = "dark"
-vim.opt.laststatus = 2
-vim.opt.showmode = true
-vim.opt.showcmd = false
-vim.opt.ruler = true
+vim.opt.title = true
+vim.opt.background = "dark"
+vim.opt.laststatus = 2
+vim.opt.showmode = true
+vim.opt.showcmd = false
+vim.opt.ruler = true
+vim.opt.cursorline = true
+
+-- Modern / visual quality
+vim.opt.termguicolors = true
+vim.opt.signcolumn = "yes"
+vim.opt.pumblend = 10
+vim.opt.winblend = 10
+
+------------------------------------------------------------
+-- Window / split behavior
+------------------------------------------------------------
+vim.opt.splitbelow = true
+vim.opt.splitright = true
+
+------------------------------------------------------------
+-- Timing & performance related
+------------------------------------------------------------
+vim.opt.updatetime = 50
+vim.opt.timeoutlen = 400
+vim.opt.ttimeoutlen = 10
+
+------------------------------------------------------------
+-- Backup, swap, undo
+------------------------------------------------------------
+vim.opt.undofile = true
+vim.opt.swapfile = false
+vim.opt.backup = false
+vim.opt.writebackup = false
------------------------------------------------------------
-- Search and highlighting
------------------------------------------------------------
-vim.opt.hlsearch = false
-vim.opt.ignorecase = true
-vim.opt.smartcase = true
-vim.opt.incsearch = true
-vim.opt.wildignore = { "*.o", "*.obj", "*.bak", "*.exe" }
+vim.opt.hlsearch = false
+vim.opt.ignorecase = true
+vim.opt.smartcase = true
+vim.opt.incsearch = true
+vim.opt.wildignore = { "*.o", "*.obj", "*.bak", "*.exe" }
------------------------------------------------------------
-- Indentation and formatting
------------------------------------------------------------
-vim.opt.autoindent = true
-vim.opt.cindent = true
-vim.opt.smartindent = true
-vim.opt.wrap = false
-vim.opt.scrolloff = 5
-vim.opt.completeopt = { "menuone", "noinsert" }
+vim.opt.autoindent = true
+vim.opt.cindent = true
+vim.opt.smartindent = true
+vim.opt.wrap = false
+vim.opt.scrolloff = 5
+vim.opt.completeopt = { "menuone", "noinsert" }
------------------------------------------------------------
-- Clipboard and mouse
------------------------------------------------------------
vim.opt.clipboard:append("unnamedplus")
-vim.opt.mouse = "a"
+vim.opt.mouse = "a"
------------------------------------------------------------
--- Session and history
+-- Session and history (shada = viminfo replacement)
------------------------------------------------------------
-vim.opt.shada = "'100,<50,s10,h"
-vim.opt.shadafile = vim.fn.expand("~/.local/state/nvim/shada/main.shada")
+vim.opt.shada = "'100,<50,s10,h"
+vim.opt.shadafile = vim.fn.expand("~/.local/state/nvim/shada/main.shada")
------------------------------------------------------------
-- Miscellaneous
------------------------------------------------------------
vim.opt.spelllang = { "en", "pl" }
-vim.cmd("colorscheme pablo")
vim.cmd("syntax on")
+vim.opt.termguicolors = true
+vim.cmd.colorscheme("pablo")
--- Transparent background
-vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
-vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
+-- Transparency
+vim.api.nvim_set_hl(0, "Normal", { bg = "none", ctermbg = "none" })
+vim.api.nvim_set_hl(0, "NormalFloat",{ bg = "none", ctermbg = "none" })
+vim.api.nvim_set_hl(0, "SignColumn", { bg = "none" })
+vim.api.nvim_set_hl(0, "FoldColumn", { bg = "none" })
------------------------------------------------------------
-- Autocommands
@@ -92,22 +127,48 @@ vim.api.nvim_create_autocmd("BufWritePost", {
------------------------------------------------------------
-- Key mappings
------------------------------------------------------------
-local map = vim.keymap.set
-local opts = { noremap = true, silent = true }
+vim.g.mapleader = " "
+
+-- Helper function for cleaner keymap definitions
+-- Defaults: noremap = true, silent = true
+local function map(mode, lhs, rhs, opts)
+ opts = opts or {}
+ opts.noremap = opts.noremap ~= false -- default true
+ opts.silent = opts.silent ~= false -- default true
+ opts.desc = opts.desc or nil -- optional description
+
+ vim.keymap.set(mode, lhs, rhs, opts)
+end
+
+-- Delete char before cursor + char under cursor
+map('n', '<BS>', 'dBx', { desc = "Delete char before + under cursor" })
+
+-- Insert blank line below current line and center view
+map('n', 's', 'o<Esc>kzz', { desc = "Insert blank line below + center" })
+
+-- Start substitute on current line (pre-filled :%s//g)
+map('n', 'S', ':%s//g<Left><Left>', { silent = false, desc = "Substitute on current line" })
+-- Note: silent = false because it enters command-line mode
-vim.g.mapleader = "\\"
+-- Yank to end of line (consistent with D and C behavior)
+map('n', 'Y', 'y$', { desc = "Yank to end of line" })
-map("n", "<BS>", "dBx", { noremap = true })
-map("n", "s", "o<Esc>kzz", { noremap = true })
-map("n", "S", ":%s//g<Left><Left>", { noremap = true })
-map("n", "Y", "y$", { noremap = true })
-map("n", "-", "ddp", { noremap = true })
-map("n", "_", "ddkP", { noremap = true })
-map("n", "<C-J>", '"+yy', { noremap = true })
-map("n", "<C-C>", '"+yW', { noremap = true })
-map("n", "<C-K>", '"+p', { noremap = true })
-map("n", "<space>", "i <esc>", { noremap = true })
-map("v", "<C-J>", '"+y', { noremap = true })
+-- Swap current line with the one below
+map('n', '-', 'ddp', { desc = "Swap line with next" })
+
+-- Swap current line with the one above
+map('n', '_', 'ddkP', { desc = "Swap line with previous" })
+
+-- System clipboard yank & paste (line / WORD)
+map('n', '<C-j>', '"+yy', { desc = "Yank line to system clipboard" })
+map('n', '<C-c>', '"+yW', { desc = "Yank WORD to system clipboard" })
+map('n', '<C-k>', '"+p', { desc = "Paste from system clipboard after cursor" })
+
+-- Yank selection to system clipboard
+map('v', '<C-j>', '"+y', { desc = "Yank selection to system clipboard" })
+
+-- Toggle buffers
+map('n', '<Tab><Tab>', '<C-^>', { desc = "Toggle last / alternate buffer" })
------------------------------------------------------------
-- Tabs & indentation
@@ -130,7 +191,6 @@ vim.api.nvim_create_autocmd("FileType", {
------------------------------------------------------------
require("config.lazy")
-
------------------------------------------------------------
-- luasnip
------------------------------------------------------------
diff --git a/.config/shell/.zshrc b/.config/shell/.zshrc
index 542c6df..5a2776f 100644
--- a/.config/shell/.zshrc
+++ b/.config/shell/.zshrc
@@ -144,6 +144,7 @@ bindkey -M vicmd '^t' htop_widget
# ─── 10) Tool initializations ─────────────────────────────────────────────────
eval "$(zoxide init zsh)"
+eval "$(thefuck --alias)"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
diff --git a/.config/shell/envvarrc b/.config/shell/envvarrc
index 81ff31f..5409662 100644
--- a/.config/shell/envvarrc
+++ b/.config/shell/envvarrc
@@ -6,9 +6,11 @@
# Primary programs
export BROWSER="librewolf"
export EDITOR="nvim"
-export IMAGE_VIEWER="feh"
+export VISUAL="nvim"
+export IMAGE_VIEWER="sxiv"
export MANPAGER="vim -M +MANPAGER -"
export TERMINAL="st"
+export TERMINAL_PROG="st"
export SHELL="zsh"
@@ -78,8 +80,9 @@ export NVIMSNIPPETS="$XDG_CONFIG_HOME/nvim/lua/snips"
export TIGRC_USER="$XDG_CONFIG_HOME/tig/tigrc"
export STARSHIP_CONFIG="$XDG_CONFIG_HOME/starship/starship.toml"
export STARSHIP_CACHE="$XDG_CACHE_HOME/starship/cache"
-export SUDO_ASKPASS="askpass"
-
+export SSH_ASKPASS="$SCRIPTS/askpass"
+export SUDO_ASKPASS="$SCRIPTS/askpass"
+export MOZ_USE_XINPUT2=1
# Applications & data
export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store"
@@ -91,3 +94,15 @@ export OBSIDIAN_HOME="$XDG_CACHE_HOME/obsidian"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="UTF-8"
+
+
+# Better less
+export LESS="R"
+export LESS_TERMCAP_mb="$(printf '%b' '')"
+export LESS_TERMCAP_md="$(printf '%b' '')"
+export LESS_TERMCAP_me="$(printf '%b' '')"
+export LESS_TERMCAP_so="$(printf '%b' '')"
+export LESS_TERMCAP_se="$(printf '%b' '')"
+export LESS_TERMCAP_us="$(printf '%b' '')"
+export LESS_TERMCAP_ue="$(printf '%b' '')"
+export LESSOPEN="| /usr/bin/highlight -O ansi %s 2>/dev/null"