Compare commits

..

4 Commits

Author SHA1 Message Date
syedm 9c0b473ea9 Fix fish config 2026-07-08 07:35:16 +01:00
syedm 3e30f0b1dc Fix nvim pasting 2026-07-08 07:28:41 +01:00
syedm 8fd2ef958f Update Fish prompt 2026-07-08 07:28:32 +01:00
syedm 49c82d2baf Fix neovim config 2026-07-08 06:10:49 +01:00
9 changed files with 365 additions and 275 deletions
+10 -1
View File
@@ -1,5 +1,14 @@
set -gx fish_greeting set -gx fish_greeting
function nix
if test "$argv[1]" = "develop"
nix develop -c fish $argv[2..-1]
else if test "$argv[1]" = "shell"
env IN_NIX_SHELL=shell nix $argv
else
nix $argv
end
end
function a function a
for arg in $argv for arg in $argv
if string match -q '*/' $arg if string match -q '*/' $arg
@@ -13,7 +22,7 @@ end
function y function y
set tmp (mktemp -t "yazi-cwd.XXXXXX") set tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file="$tmp" yazi $argv --cwd-file="$tmp"
if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
builtin cd -- "$cwd" builtin cd -- "$cwd"
end end
end end
+65
View File
@@ -1,3 +1,68 @@
if test "$KITTY_STR" = "1" if test "$KITTY_STR" = "1"
if not set -q _FASTFETCH_RUN
set -gx _FASTFETCH_RUN 1
fastfetch fastfetch
end
end
function postexec_test --on-event fish_postexec
echo
end
function fish_prompt
set -l last_status $status
set -l markers
set -l user $USER
set -l host (hostname)
if test -n "$IN_NIX_SHELL"
if test "$IN_NIX_SHELL" = "shell"
set -a markers "nix-shell"
else if test "$IN_NIX_SHELL" = "pure"; or test "$IN_NIX_SHELL" = "impure"
set -a markers "nix-develop"
end
end
if test -n "$VIRTUAL_ENV"
set -a markers "venv:"(basename "$VIRTUAL_ENV")
end
if test -n "$CONDA_DEFAULT_ENV"
set -a markers "conda:"$CONDA_DEFAULT_ENV
end
if test -n "$BUN_INSTALL"
set -a markers "bun"
end
if test $last_status -ne 0
set_color ff007c
echo -n "[$last_status] "
end
set_color 7aa2f7
echo -n "$user"
set_color white
echo -n "@"
set_color 9ece6a
echo -n "$host "
set_color 89ddff
echo -n (prompt_pwd)
set_color bb9af7
echo -n (fish_git_prompt)
if test (count $markers) -gt 0
set_color ff9e64
echo -n " ("(string join " " $markers)")"
end
echo
set_color 73daca
echo -n "λ "
set_color normal
end end
+2 -2
View File
@@ -47,7 +47,7 @@
clang-tools clang-tools
stylua stylua
]; ];
initLua = builtins.readFile ./init.lua;
}; };
home.file.".config/nvim".source = ./.;
} }
+8 -272
View File
@@ -1,273 +1,9 @@
-- Options require("extra")
local o = vim.opt require("keymaps")
local g = vim.g require("lsp")
g.mapleader = " " require("options")
g.loaded_perl_provider = 0 require("plugins")
g.loaded_ruby_provider = 0
g.clipboard = "osc52"
o.number = true
o.winborder = "rounded"
o.expandtab = true
o.shiftwidth = 2
o.tabstop = 4
o.softtabstop = 4
o.completeopt = { "menuone", "noselect", "noinsert" }
o.updatetime = 100
o.timeoutlen = 300
o.clipboard = "unnamedplus"
o.foldenable = false
o.list = true
o.listchars = {
tab = "",
eol = " ",
space = " ",
nbsp = "",
trail = "·",
lead = "·",
}
o.scroll = 5
o.smoothscroll = true
o.termguicolors = true
o.laststatus = 3
o.mousescroll = "ver:0,hor:0"
vim.lsp.semantic_tokens.enable = false if vim.env.SSH_CONNECTION or vim.env.SSH_TTY then
vim.g.clipboard = "osc52"
vim.diagnostic.config({ end
float = {
border = "rounded",
},
})
vim.g.rainbow_delimiters = {
highlight = {
"RainbowDelimiterYellow",
"RainbowDelimiterBlue",
"RainbowDelimiterOrange",
"RainbowDelimiterGreen",
"RainbowDelimiterViolet",
"RainbowDelimiterCyan",
"RainbowDelimiterRed",
},
}
vim.diagnostic.config({
virtual_text = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "󰅚 ",
[vim.diagnostic.severity.WARN] = "󰀪 ",
[vim.diagnostic.severity.INFO] = "󰋽 ",
[vim.diagnostic.severity.HINT] = "󰌶 ",
},
},
underline = true,
update_in_insert = true,
severity_sort = true,
})
-- LSP config
local capabilities = require("cmp_nvim_lsp").default_capabilities()
vim.lsp.config("lua_ls", {
capabilities = capabilities,
settings = {
Lua = {
diagnostics = {
globals = {
"vim",
},
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = {
enable = false,
},
},
},
})
vim.lsp.config("clangd", {
capabilities = capabilities,
})
vim.lsp.enable("lua_ls")
vim.lsp.enable("clangd")
-- Plugins
require("picvim").setup({})
require("notify").setup({})
require("gitsigns").setup({})
require("mini.pairs").setup({})
require("rainbow-delimiters.setup").setup({})
require("neo-tree").setup({
filesystem = {
filtered_items = {
visible = true,
},
},
})
require("lualine").setup({
options = {
theme = "auto",
},
sections = {
lualine_b = {
{ "branch" },
{
"diff",
symbols = {
added = "",
modified = "",
removed = "",
},
diff_color = {
added = { fg = "#a6e3a1" },
modified = { fg = "#f9e2af" },
removed = { fg = "#f38ca8" },
},
},
},
},
})
require("nvim-cursorline").setup({
cursorline = {
enable = true,
timeout = 0,
number = false,
},
cursorword = {
enable = true,
min_length = 1,
hl = {
underline = true,
},
},
})
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
})
local cmp = require("cmp")
cmp.setup({
window = {
completion = cmp.config.window.bordered({
border = "rounded",
}),
documentation = cmp.config.window.bordered({
border = "rounded",
}),
},
mapping = cmp.mapping.preset.insert({
["<CR>"] = cmp.mapping.confirm({
select = true,
}),
["<Tab>"] = cmp.mapping.select_next_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item(),
}),
sources = {
{
name = "nvim_lsp",
},
{
name = "clangd",
},
},
})
local neoscroll = require("neoscroll")
neoscroll.setup({
mappings = {
"<C-u>",
"<C-d>",
"<C-b>",
"<C-f>",
"<C-y>",
"<C-e>",
"zt",
"zz",
"zb",
},
})
-- Keymaps
local map = vim.keymap.set
map({ "n", "i", "v" }, "<C-s>", "<cmd>w<CR>")
map("n", ";", ":")
map("n", "<A-Up>", ":move-2<CR>")
map("n", "<A-Down>", ":move+1<CR>")
map("x", "<A-Up>", ":move '<-2<CR>gv")
map("x", "<A-Down>", ":move '>+1<CR>gv")
map("i", "<A-Up>", "<C-o>:move-2<CR>")
map("i", "<A-Down>", "<C-o>:move+1<CR>")
map("n", ">", ">>")
map("v", ">", ">gv")
map("n", "<", "<<")
map("v", "<", "<gv")
map("n", ".", ">>")
map("v", ".", ">gv")
map("n", ",", "<<")
map("v", ",", "<gv")
map("n", "<Esc>", "<cmd>nohlsearch<CR><Esc>")
map("n", "u", "ggVG")
map("n", "z", "<cmd>u<CR>")
map("n", "d", "<cmd>red<CR>")
map("n", "q", "<cmd>Neotree<CR>")
map("n", "<A-a>", "<cmd>Minuet virtualtext toggle<CR>")
map("x", "p", '"_dP')
map("x", "P", '"_dP')
map("n", "\\", function()
vim.cmd([[
Neotree close
mksession! p.vim
echo "saved session"
]])
end)
map("n", "<ScrollWheelUp>", function()
neoscroll.scroll(-0.05, { move_cursor = false, duration = 20 })
end)
map("n", "<ScrollWheelDown>", function()
neoscroll.scroll(0.05, { move_cursor = false, duration = 20 })
end)
map("n", "<C-Up>", function()
neoscroll.scroll(-0.1, { move_cursor = false, duration = 50 })
end)
map("n", "<C-Down>", function()
neoscroll.scroll(0.1, { move_cursor = false, duration = 50 })
end)
-- Vimscript stuff
vim.cmd([[
aunmenu PopUp
colorscheme tokyonight-night
]])
-- AutoCMD's
local autocmd = vim.api.nvim_create_autocmd
autocmd("CursorHold", {
callback = function()
vim.diagnostic.open_float(nil, {
focusable = false,
border = "rounded",
source = "if_many",
})
end,
})
+30
View File
@@ -0,0 +1,30 @@
-- Vimscript
vim.cmd([[
aunmenu PopUp
colorscheme tokyonight-night
]])
-- AutoCMD's
local autocmd = vim.api.nvim_create_autocmd
autocmd("CursorHold", {
callback = function()
vim.diagnostic.open_float(nil, {
focusable = false,
border = "rounded",
source = "if_many",
})
end,
})
vim.api.nvim_create_autocmd("VimLeavePre", {
callback = function()
if vim.fn.filereadable("p.vim") == 1 then
vim.cmd([[
Neotree close
mksession! p.vim
echo "saved session"
]])
end
end,
})
+47
View File
@@ -0,0 +1,47 @@
-- Keymaps
local map = vim.keymap.set
map({ "n", "i", "v" }, "<C-s>", "<cmd>w<CR>")
map("n", ";", ":")
map("n", "<A-Up>", ":move-2<CR>")
map("n", "<A-Down>", ":move+1<CR>")
map("x", "<A-Up>", ":move '<-2<CR>gv")
map("x", "<A-Down>", ":move '>+1<CR>gv")
map("i", "<A-Up>", "<C-o>:move-2<CR>")
map("i", "<A-Down>", "<C-o>:move+1<CR>")
map("n", ">", ">>")
map("v", ">", ">gv")
map("n", "<", "<<")
map("v", "<", "<gv")
map("n", ".", ">>")
map("v", ".", ">gv")
map("n", ",", "<<")
map("v", ",", "<gv")
map("n", "<Esc>", "<cmd>nohlsearch<CR><Esc>")
map("n", "u", "ggVG")
map("n", "z", "<cmd>u<CR>")
map("n", "d", "<cmd>red<CR>")
map("n", "q", "<cmd>Neotree<CR>")
map("n", "<A-a>", "<cmd>Minuet virtualtext toggle<CR>")
map("v", "p", "P")
map("n", "\\", function()
vim.cmd([[
Neotree close
mksession! p.vim
echo "saved session"
]])
end)
local neoscroll = require("neoscroll")
map("n", "<ScrollWheelUp>", function()
neoscroll.scroll(-0.05, { move_cursor = false, duration = 20 })
end)
map("n", "<ScrollWheelDown>", function()
neoscroll.scroll(0.05, { move_cursor = false, duration = 20 })
end)
map("n", "<C-Up>", function()
neoscroll.scroll(-0.1, { move_cursor = false, duration = 50 })
end)
map("n", "<C-Down>", function()
neoscroll.scroll(0.1, { move_cursor = false, duration = 50 })
end)
+28
View File
@@ -0,0 +1,28 @@
-- LSP config
local capabilities = require("cmp_nvim_lsp").default_capabilities()
vim.lsp.config("lua_ls", {
capabilities = capabilities,
settings = {
Lua = {
diagnostics = {
globals = {
"vim",
},
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
},
telemetry = {
enable = false,
},
},
},
})
vim.lsp.config("clangd", {
capabilities = capabilities,
})
vim.lsp.enable("lua_ls")
vim.lsp.enable("clangd")
+66
View File
@@ -0,0 +1,66 @@
-- Options
local o = vim.opt
local g = vim.g
g.mapleader = " "
g.loaded_perl_provider = 0
g.loaded_ruby_provider = 0
o.number = true
o.winborder = "rounded"
o.expandtab = true
o.shiftwidth = 2
o.tabstop = 4
o.softtabstop = 4
o.completeopt = { "menuone", "noselect", "noinsert" }
o.updatetime = 100
o.timeoutlen = 300
o.clipboard = "unnamedplus"
o.foldenable = false
o.list = true
o.listchars = {
tab = "",
eol = " ",
space = " ",
nbsp = "",
trail = "·",
lead = "·",
}
o.scroll = 5
o.smoothscroll = true
o.termguicolors = true
o.laststatus = 3
o.mousescroll = "ver:0,hor:0"
vim.lsp.semantic_tokens.enable = false
vim.diagnostic.config({
float = {
border = "rounded",
},
})
vim.g.rainbow_delimiters = {
highlight = {
"RainbowDelimiterYellow",
"RainbowDelimiterBlue",
"RainbowDelimiterOrange",
"RainbowDelimiterGreen",
"RainbowDelimiterViolet",
"RainbowDelimiterCyan",
"RainbowDelimiterRed",
},
}
vim.diagnostic.config({
virtual_text = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "󰅚 ",
[vim.diagnostic.severity.WARN] = "󰀪 ",
[vim.diagnostic.severity.INFO] = "󰋽 ",
[vim.diagnostic.severity.HINT] = "󰌶 ",
},
},
underline = true,
update_in_insert = true,
severity_sort = true,
})
+109
View File
@@ -0,0 +1,109 @@
-- Plugins
require("picvim").setup({})
require("notify").setup({})
require("gitsigns").setup({})
require("mini.pairs").setup({})
require("rainbow-delimiters.setup").setup({})
require("neo-tree").setup({
filesystem = {
filtered_items = {
visible = true,
},
},
})
require("lualine").setup({
options = {
theme = "auto",
},
sections = {
lualine_b = {
{ "branch" },
{
"diff",
symbols = {
added = "",
modified = "",
removed = "",
},
diff_color = {
added = { fg = "#a6e3a1" },
modified = { fg = "#f9e2af" },
removed = { fg = "#f38ca8" },
},
},
},
},
})
require("nvim-cursorline").setup({
cursorline = {
enable = true,
timeout = 0,
number = false,
},
cursorword = {
enable = true,
min_length = 1,
hl = {
underline = true,
},
},
})
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
})
local cmp = require("cmp")
cmp.setup({
window = {
completion = cmp.config.window.bordered({
border = "rounded",
}),
documentation = cmp.config.window.bordered({
border = "rounded",
}),
},
mapping = cmp.mapping.preset.insert({
["<CR>"] = cmp.mapping.confirm({
select = true,
}),
["<Tab>"] = cmp.mapping.select_next_item(),
["<S-Tab>"] = cmp.mapping.select_prev_item(),
}),
sources = {
{
name = "nvim_lsp",
},
{
name = "clangd",
},
},
})
require("neoscroll").setup({
mappings = {
"<C-u>",
"<C-d>",
"<C-b>",
"<C-f>",
"<C-y>",
"<C-e>",
"zt",
"zz",
"zb",
},
})