nvim dots, plus minor mods

This commit is contained in:
2024-02-18 13:19:05 +01:00
parent bc58192623
commit 815e9d2527
17 changed files with 419 additions and 9 deletions

View File

@@ -32,6 +32,8 @@ $fileManager = nemo
$tcmd = krusader
$menu = rofi -show drun
$lock = swaylock --screenshots --effect-pixelate 20 --effect-vignette 0.5:0.5 --fade-in 0.2
$editor = neovide
$browser = firefox
# Some default env vars.
env = XCURSOR_SIZE,16
@@ -185,7 +187,7 @@ windowrule=opacity 1.0 override 1.0, ^(firefox)$
# Example windowrule v2
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
windowrulev2 = nomaximizerequest, class:.* # You'll probably like this.
# windowrulev2 = nomaximizerequest, class:.* # You'll probably like this.
windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$
windowrulev2 = noanim,class:^(xwaylandvideobridge)$
@@ -208,6 +210,9 @@ bind = $mainMod SHIFT, Q, exit,
# bind = $mainMod, M, exit,
bind = $mainMod, E, exec, $tcmd
bind = $mainMod, N, exec, $fileManager
bind = $mainMod, W, exec, $editor
bind = $mainMod, Z, exec, $terminal
bind = $mainMod, B, exec, $browser
bind = $mainMod, V, togglefloating,
bind = $mainMod SHIFT, L, exec, $lock
# bind = $mainMod, R, exec, $menu

View File

@@ -1,7 +1,7 @@
# include ${HOME}/.cache/wal/kitty.conf
include macchiato.conf
font_family CartographCF Nerd Font
font_family FiraCode Nerd Font
bold_font auto
italic_font auto
bold_italic_font auto
@@ -22,4 +22,4 @@ enable_audio_bell no
# BEGIN_KITTY_THEME
# Catppuccin-Macchiato
include current-theme.conf
# END_KITTY_THEME
# END_KITTY_THEME

View File

@@ -0,0 +1,5 @@
vsync = true
[font]
normal = ["FiraCode Nerd Font"]
size = 15

View File

@@ -0,0 +1,3 @@
# Example_config
This can be used as an example custom config for NvChad. Do check the https://github.com/NvChad/nvcommunity

View File

@@ -0,0 +1,25 @@
---@type ChadrcConfig
local M = {}
-- Path to overriding theme and highlights files
local highlights = require "custom.highlights"
M.ui = {
theme = "catppuccin",
theme_toggle = { "catppuccin", "everforest_light" },
hl_override = highlights.override,
hl_add = highlights.add,
-- nvdash (dashboard)
nvdash = {
load_on_startup = true,
}
}
M.plugins = "custom.plugins"
-- check core.mappings for table structure
M.mappings = require "custom.mappings"
return M

View File

@@ -0,0 +1,25 @@
--type conform.options
local options = {
lsp_fallback = true,
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettier" },
css = { "prettier" },
html = { "prettier" },
sh = { "shfmt" },
},
-- adding same formatter for multiple filetypes can look too much work for some
-- instead of the above code you could just use a loop! the config is just a table after all!
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}
require("conform").setup(options)

View File

@@ -0,0 +1,31 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
local util = require "lspconfig/util"
-- if you just want default config for the servers then put them in a table
local servers = { "html", "cssls", "tsserver", "clangd" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
end
lspconfig.rust_analyzer.setup({
on_attach = on_attach,
capabilities = capabilities,
filetypes = {"rust"},
root_dir = util.root_pattern("Cargo.toml"),
settings = {
['rust_analyzer'] = {
cargo = {
allFeatures = true,
},
},
},
})
--
-- lspconfig.pyright.setup { blabla}

View File

@@ -0,0 +1,59 @@
local M = {}
M.treesitter = {
ensure_installed = {
"vim",
"lua",
"html",
"css",
"javascript",
"typescript",
"tsx",
"c",
"markdown",
"markdown_inline",
},
indent = {
enable = true,
-- disable = {
-- "python"
-- },
},
}
M.mason = {
ensure_installed = {
-- lua stuff
"lua-language-server",
"stylua",
-- web dev stuff
"css-lsp",
"html-lsp",
"typescript-language-server",
"deno",
"prettier",
-- c/cpp stuff
"clangd",
"clang-format",
},
}
-- git support in nvimtree
M.nvimtree = {
git = {
enable = true,
},
renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}
return M

View File

@@ -0,0 +1,19 @@
-- To find any highlight groups: "<cmd> Telescope highlights"
-- Each highlight group can take a table with variables fg, bg, bold, italic, etc
-- base30 variable names can also be used as colors
local M = {}
---@type Base46HLGroupsList
M.override = {
Comment = {
italic = true,
},
}
---@type HLTable
M.add = {
NvimTreeOpenedFolderName = { fg = "green", bold = true },
}
return M

View File

@@ -0,0 +1,7 @@
-- local autocmd = vim.api.nvim_create_autocmd
-- Auto resize panes when resizing nvim window
-- autocmd("VimResized", {
-- pattern = "*",
-- command = "tabdo wincmd =",
-- })

View File

@@ -0,0 +1,24 @@
---@type MappingsTable
local M = {}
M.general = {
n = {
[";"] = { ":", "enter command mode", opts = { nowait = true } },
-- format with conform
["<leader>fm"] = {
function()
require("conform").format()
end,
"formatting",
}
},
v = {
[">"] = { ">gv", "indent"},
},
}
-- more keybinds!
return M

View File

@@ -0,0 +1,102 @@
local overrides = require("custom.configs.overrides")
---@type NvPluginSpec[]
local plugins = {
-- Override plugin definition options
{
"neovim/nvim-lspconfig",
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end, -- Override to setup mason-lspconfig
},
-- override plugin configs
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"rust-analyzer",
}
},
},
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
},
{
"nvim-tree/nvim-tree.lua",
opts = overrides.nvimtree,
},
{
"neovim/nvim-lspconfig",
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end,
},
{
"rust-lang/rust.vim",
ft = "rust",
init = function ()
vim.g.rustfmt_autosave = 1
end
},
{
"saecki/crates.nvim",
ft = {"rust", "toml"},
config = function(_, opts)
local crates = require('crates')
crates.setup(opts)
crates.show()
end,
},
{
"hrsh7th/nvim-cmp",
opts = function()
local M = require "plugins.configs.cmp"
table.insert(M.sources, {name = "crates"})
return M
end,
},
-- Install a plugin
{
"max397574/better-escape.nvim",
event = "InsertEnter",
config = function()
require("better_escape").setup()
end,
},
{
"stevearc/conform.nvim",
-- for users those who want auto-save conform + lazyloading!
-- event = "BufWritePre"
config = function()
require "custom.configs.conform"
end,
},
-- To make a plugin not be loaded
-- {
-- "NvChad/nvim-colorizer.lua",
-- enabled = false
-- },
-- All NvChad plugins are lazy-loaded by default
-- For a plugin to be loaded, you will need to set either `ft`, `cmd`, `keys`, `event`, or set `lazy = false`
-- If you want a plugin to load on startup, add `lazy = false` to a plugin spec, for example
-- {
-- "mg979/vim-visual-multi",
-- lazy = false,
-- }
}
return plugins

View File

@@ -51,9 +51,9 @@
"spacing": 10
},
"clock": {
"format": "{:%I:%M %p}",
"format": "{:%a %b-%d %I:%M %p}",
"tooltip-format": "<big>{:%d %B %Y}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%Y-%m-%d}"
"format-alt": "{:%Y-%m-%d %H:%M %Z}"
},
"cpu": {
"format": "{usage}% ",

View File

@@ -1,5 +1,4 @@
romkatv/powerlevel10k
rupa/z
ohmyzsh/ohmyzsh path:lib
ohmyzsh/ohmyzsh path:plugins/extract

View File

@@ -1,8 +1,9 @@
export QT_STYLE_OVERRIDE="kvantum";
# Defaults
export TERM="kitty";
export TERMINAL="kitty";
export EDITOR='lvim';
export EDITOR='vim';
export BROWSER='firefox';
export BAT_THEME="Catppuccin-mocha";

View File

@@ -11,7 +11,7 @@ HISTSIZE=10000000
SAVEHIST=10000000
setopt extendedglob
unsetopt autocd beep
bindkey -e
bindkey -v
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/mike/.zshrc'
@@ -24,5 +24,110 @@ source '/usr/share/zsh-antidote/antidote.zsh'
antidote load
source ~/.aliases
# =============================================================================
#
# Utility functions for zoxide.
#
# pwd based on the value of _ZO_RESOLVE_SYMLINKS.
function __zoxide_pwd() {
\builtin pwd -L
}
# cd + custom logic based on the value of _ZO_ECHO.
function __zoxide_cd() {
# shellcheck disable=SC2164
\builtin cd -- "$@"
}
# =============================================================================
#
# Hook configuration for zoxide.
#
# Hook to add new entries to the database.
function __zoxide_hook() {
# shellcheck disable=SC2312
\command zoxide add -- "$(__zoxide_pwd)"
}
# Initialize hook.
# shellcheck disable=SC2154
if [[ ${precmd_functions[(Ie)__zoxide_hook]:-} -eq 0 ]] && [[ ${chpwd_functions[(Ie)__zoxide_hook]:-} -eq 0 ]]; then
chpwd_functions+=(__zoxide_hook)
fi
# =============================================================================
#
# When using zoxide with --no-cmd, alias these internal functions as desired.
#
__zoxide_z_prefix='z#'
# Jump to a directory using only keywords.
function __zoxide_z() {
# shellcheck disable=SC2199
if [[ "$#" -eq 0 ]]; then
__zoxide_cd ~
elif [[ "$#" -eq 1 ]] && { [[ -d "$1" ]] || [[ "$1" = '-' ]] || [[ "$1" =~ ^[-+][0-9]$ ]]; }; then
__zoxide_cd "$1"
elif [[ "$@[-1]" == "${__zoxide_z_prefix}"?* ]]; then
# shellcheck disable=SC2124
\builtin local result="${@[-1]}"
__zoxide_cd "${result:${#__zoxide_z_prefix}}"
else
\builtin local result
# shellcheck disable=SC2312
result="$(\command zoxide query --exclude "$(__zoxide_pwd)" -- "$@")" &&
__zoxide_cd "${result}"
fi
}
# Jump to a directory using interactive search.
function __zoxide_zi() {
\builtin local result
result="$(\command zoxide query --interactive -- "$@")" && __zoxide_cd "${result}"
}
# Completions.
if [[ -o zle ]]; then
function __zoxide_z_complete() {
# Only show completions when the cursor is at the end of the line.
# shellcheck disable=SC2154
[[ "${#words[@]}" -eq "${CURRENT}" ]] || return 0
if [[ "${#words[@]}" -eq 2 ]]; then
_files -/
elif [[ "${words[-1]}" == '' ]] && [[ "${words[-2]}" != "${__zoxide_z_prefix}"?* ]]; then
\builtin local result
# shellcheck disable=SC2086,SC2312
if result="$(\command zoxide query --exclude "$(__zoxide_pwd)" --interactive -- ${words[2,-1]})"; then
result="${__zoxide_z_prefix}${result}"
# shellcheck disable=SC2296
compadd -Q "${(q-)result}"
fi
\builtin printf '\e[5n'
fi
return 0
}
\builtin bindkey '\e[0n' 'reset-prompt'
[[ "${+functions[compdef]}" -ne 0 ]] && \compdef __zoxide_z_complete __zoxide_z
fi
# =============================================================================
#
# Commands for zoxide. Disable these using --no-cmd.
#
\builtin alias cd=__zoxide_z
\builtin alias cdi=__zoxide_zi
# =============================================================================
#
# To initialize zoxide, add this to your configuration (usually ~/.zshrc):
#
eval "$(zoxide init zsh)"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh