Add dependencies

This commit is contained in:
lif
2025-10-27 15:25:39 +00:00
parent 3a1d62dd5a
commit af8b8e0fc6
6 changed files with 366 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
secrets.fish

33
config/fish/config.fish Normal file
View File

@@ -0,0 +1,33 @@
set --universal nvm_default_version v22.19.0
set fish_add_path $HOME/.local/bin
# Get directory of this config file
set -l config_dir (dirname (status current-filename))
# go install github.com/mitranim/gow@latest
# Path to secrets file relative to config.fish
set -l secrets_file "$config_dir/secrets.fish"
set -gx GOPATH "$HOME/go"
set -gx JAVA_HOME "/usr/lib/jvm/java-17-openjdk/"
set -gx ANDROID_HOME $HOME"/Android/Sdk/"
fish_add_path -a "$GOPATH/bin"
# Source if it exists
if test -f $secrets_file
source $secrets_file
end
function fish_greeting
# fastfetch
# echo $ADMIN_TOKEN
# set twing twong
end
function cap
git commit -a && git pull && git push && git pull
end
function pbcopy
read -lz input
echo -n $input | xclip -selection c
end

2
config/fish/fish_plugins Normal file
View File

@@ -0,0 +1,2 @@
jorgebucaran/fisher
jorgebucaran/nvm.fish

10
config/nvim/.luarc.json Normal file
View File

@@ -0,0 +1,10 @@
{
"settings": {
"Lua": {
"diagnostics": {
"globals": ["vim"]
}
}
}
}

273
config/nvim/init.lua Normal file
View File

@@ -0,0 +1,273 @@
-- -----------------------------------------------------------------------------------------------
-- General configuration
-- -----------------------------------------------------------------------------------------------
-- Basic settings
vim.opt.hlsearch = true
vim.opt.number = true
vim.opt.mouse = "a"
vim.opt.showmode = false
vim.opt.spelllang = "en_gb"
vim.opt.title = true
vim.opt.titlestring = "nvim"
-- Leader (this is here so plugins etc pick it up)
vim.g.mapleader = " " -- anywhere you see <leader> = hit ,
-- use nvim-tree instead
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Use system clipboard
vim.opt.clipboard:append({ "unnamed", "unnamedplus" })
-- Display settings
vim.opt.termguicolors = true
vim.o.background = "dark" -- set to "dark" for dark theme
-- Scrolling and UI settings
vim.opt.cursorline = true
vim.opt.cursorcolumn = true
vim.opt.signcolumn = 'yes'
vim.opt.wrap = false
vim.opt.sidescrolloff = 8
vim.opt.scrolloff = 8
-- Persist undo (persists your undo history between sessions)
vim.opt.undodir = vim.fn.stdpath("cache") .. "/undo"
vim.opt.undofile = true
-- Tab stuff
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.autoindent = true
-- Search configuration
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.gdefault = true
-- open new split panes to right and below (as you probably expect)
vim.opt.splitright = true
vim.opt.splitbelow = true
-- LSP
vim.lsp.inlay_hint.enable(true)
-- -----------------------------------------------------------------------------------------------
-- Plugin list
-- -----------------------------------------------------------------------------------------------
local plugins = {
{ "nvim-lua/plenary.nvim" }, -- used by several other plugins
{ "catppuccin/nvim" },
{ "nvim-tree/nvim-web-devicons", lazy = true }, -- used by lualine and nvim-tree
{ "nvim-lualine/lualine.nvim" }, -- Status line
{ "nvim-tree/nvim-tree.lua" }, -- File browser
{ "numToStr/Comment.nvim" },
{ "nvim-lua/plenary.nvim" },
{ "ThePrimeagen/harpoon" },
-- Telescope command menu
{ "nvim-telescope/telescope.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
-- TreeSitter
{ "nvim-treesitter/nvim-treesitter", priority = 1000, build = ":TSUpdate" },
-- LSP
{ 'mason-org/mason.nvim' }, -- installs LSP servers
{ 'neovim/nvim-lspconfig' }, -- configures LSPs
{ 'mason-org/mason-lspconfig.nvim' }, -- links installed to configured
{ 'stevearc/conform.nvim' }, -- Formatting where the LSP doesn't
-- AI trash
-- { 'supermaven-inc/supermaven-nvim' },
{
'saghen/blink.cmp', -- Blink completion tool (LSP, snippets etc)
version = '1.*', -- see keymap here:
-- opts_extend = { "sources.default" } -- https://cmp.saghen.dev/configuration/keymap.html#default
opts = {
keymap = { preset = "default" },
sources = {
default = { "lsp", "path", "buffer" },
},
},
},
}
-- -----------------------------------------------------------------------------------------------
-- Plugin installation
-- -----------------------------------------------------------------------------------------------
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git", "clone", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup(plugins)
-- -----------------------------------------------------------------------------------------------
-- Plugin config
-- -----------------------------------------------------------------------------------------------
vim.cmd.colorscheme("catppuccin") -- activate the theme
require("lualine").setup() -- the status line
require("nvim-tree").setup() -- the tree file browser panel
require("telescope").setup() -- command menu
require("Comment").setup()
-- require("supermaven-nvim").setup({})
-- -----------------------------------------------------------------------------------------------
-- Treesitter (syntax highlighting and related stuff!)
-- -----------------------------------------------------------------------------------------------
-- NB: Make sure to add more from this list!
-- https://github.com/nvim-treesitter/nvim-treesitter/tree/master#supported-languages
require("nvim-treesitter.configs").setup({
ensure_installed = { "typescript", "python", "rust", "go" },
sync_install = false,
auto_install = true,
highlight = { enable = true, },
})
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.opt.foldlevel = 99
-- -----------------------------------------------------------------------------------------------
-- LSP
-- -----------------------------------------------------------------------------------------------
-- NB: These will FAIL if you don't have the language toolchains installed!
-- NB: Make sure to add more from this list!
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
require("mason").setup()
require("mason-lspconfig").setup({ ensure_installed = { "gopls", "bashls", "beautysh" } })
require("conform").setup({
default_format_opts = { lsp_format = "fallback" }, -- Many languages can be formatted directly by their LSP
formatters_by_ft = { -- but some can't, so conform is for those ones
bash = { "beautysh" },
javascript = { "prettier" },
javascriptreact = { "prettier" },
typescript = { "prettier" },
typescriptreact = { "prettier" },
json = { "prettier" },
html = { "prettier" },
css = { "prettier" },
},
})
-- -----------------------------------------------------------------------------------------------
-- Keymap settings
-- -----------------------------------------------------------------------------------------------
-- Basic keys
vim.keymap.set("n", "<space>", ":") -- hit <space> to start a command, quicker than :
-- vim.keymap.set("n", "q", "<C-r>") -- "u" is undo, I map "q" to redo
-- Search navigation
-- n is always forward, N is always backward
-- ' is now forward and ; is backward
vim.keymap.set("n", "n", "v:searchforward ? 'n' : 'N'", { expr = true })
vim.keymap.set("n", "N", "v:searchforward ? 'N' : 'n'", { expr = true })
vim.keymap.set({ "n", "v" }, ";", "getcharsearch().forward ? ',' : ';'", { expr = true })
vim.keymap.set({ "n", "v" }, "'", "getcharsearch().forward ? ';' : ','", { expr = true })
-- toggle line numbers and wrap
vim.keymap.set("n", "<leader>n", ":set nonumber! relativenumber!<CR>")
vim.keymap.set("n", "<leader>w", ":set wrap! wrap?<CR>")
-- Moving between splits and resizing
vim.keymap.set("n", "<C-j>", "<C-W><C-J>") -- use Ctrl-j (and so on) to move between splits
vim.keymap.set("n", "<C-k>", "<C-W><C-K>")
vim.keymap.set("n", "<C-l>", "<C-W><C-L>")
vim.keymap.set("n", "<C-H>", "<C-W><C-H>")
vim.keymap.set("n", "<C-S-H>", ":vertical resize -2<CR>")
vim.keymap.set("n", "<C-S-L>", ":vertical resize +2<CR>")
vim.keymap.set("n", "<C-S-K>", ":resize -2<CR>")
vim.keymap.set("n", "<C-S-J>", ":resize +2<CR>")
-- nvim-tree (file browser settings)
vim.keymap.set("n", "<C-t>", ":NvimTreeFocus<CR>")
vim.keymap.set("n", "<C-f>", ":NvimTreeFindFile<CR>")
vim.keymap.set("n", "<C-c>", ":NvimTreeClose<CR>")
-- Formatting
vim.keymap.set("n", "<leader>fo", require('conform').format)
vim.keymap.set('n', '<leader>k', vim.diagnostic.goto_next, { desc = "Next diagnostic" })
-- vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = "Prev diagnostic" })
local tele_builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>ff", tele_builtin.git_files, {}) -- ,ff to find git files
vim.keymap.set("n", "<leader>fa", tele_builtin.find_files, {}) -- ,fa to find any files
vim.keymap.set("n", "<leader>fg", tele_builtin.live_grep, {}) -- ,fg to ripgrep
vim.keymap.set("n", "<leader>fb", tele_builtin.buffers, {}) -- ,fb to see recent buffers
vim.keymap.set("n", "<leader>fh", tele_builtin.help_tags, {}) -- ,fh to search help
vim.keymap.set("n", "<leader>v", require("harpoon.ui").toggle_quick_menu, {}) -- ,fh to search help
vim.keymap.set("n", "<leader>b", require("harpoon.mark").add_file, {}) -- ,fh to search help
-- ===============================================================================================
-- Recommended extra keymaps for a modern Neovim workflow
-- ===============================================================================================
-- ----------------------------
-- LSP / IDE-like keymaps
-- ----------------------------
-- These should work in all buffers with an LSP attached
vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show hover documentation" })
vim.keymap.set("i", "<C-k>", vim.lsp.buf.signature_help, { desc = "Show signature help" })
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, { desc = "Go to definition" })
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, { desc = "List references" })
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "Rename symbol" })
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "Code actions" })
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Previous diagnostic" })
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Send diagnostics to location list" })
vim.keymap.set("n", "<leader>f", function() vim.lsp.buf.format({ async = true }) end, { desc = "Format buffer" })
-- ----------------------------
-- Telescope / fuzzy finding
-- ----------------------------
-- local tele_builtin = require("telescope.builtin")
-- vim.keymap.set("n", "<leader>fs", tele_builtin.lsp_document_symbols, { desc = "Document symbols" })
-- vim.keymap.set("n", "<leader>fS", tele_builtin.lsp_workspace_symbols, { desc = "Workspace symbols" })
-- vim.keymap.set("n", "<leader>fo", tele_builtin.oldfiles, { desc = "Recently opened files" })
-- ----------------------------
-- Clipboard convenience
-- ----------------------------
vim.keymap.set({ "n", "v" }, "<leader>y", '"+y', { desc = "Yank to system clipboard" })
vim.keymap.set("n", "<leader>p", '"+p', { desc = "Paste from system clipboard" })
-- ----------------------------
-- Window / tab navigation enhancements
-- ----------------------------
vim.keymap.set("n", "<leader>ww", "<C-w>p", { desc = "Switch to last window" })
vim.keymap.set("n", "<leader>to", ":tabnew<CR>", { desc = "New tab" })
vim.keymap.set("n", "<leader>tn", ":tabnext<CR>", { desc = "Next tab" })
vim.keymap.set("n", "<leader>tp", ":tabprevious<CR>", { desc = "Previous tab" })
-- ----------------------------
-- Folding (Treesitter)
-- ----------------------------
vim.keymap.set("n", "za", "za", { desc = "Toggle fold under cursor" })
vim.keymap.set("n", "zR", "zR", { desc = "Open all folds" })
vim.keymap.set("n", "zM", "zM", { desc = "Close all folds" })
-- ----------------------------
-- Highlight on yank
-- ----------------------------
vim.cmd([[
augroup YankHighlight
autocmd!
autocmd TextYankPost * silent! lua vim.highlight.on_yank{higroup="IncSearch", timeout=200}
augroup END
]])
-- Show diagnostic message in a floating window
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Show diagnostics in float" })

47
deploy.sh Normal file
View File

@@ -0,0 +1,47 @@
#!/bin/bash
source_dir="./config"
target_config_dir="$HOME/.config"
nodejs_version="v22.21.0"
# Ensure fish/fisher setup + install plugins
if fish -c "which fisher" >/dev/null 2>&1; then
echo "fisher is installed"
else
echo "fisher not found. installing."
# curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
fish -c "curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher"
fi
for dir in "$source_dir"/*/; do
if [ -d "$dir" ]; then # Check if it's a directory
dir_name=$(basename "$dir")
source=$source_dir"/"$dir_name
target=$target_config_dir"/"$dir_name
echo "Source: " $source
echo "Target: " $target
# rm -rf $target
if [ "$(ls -A $source)" ]; then
mkdir -p $target
cp -rf "$source/"* "$target/"
else
echo "$source is empty"
fi
fi
done
fish -c "fisher update"
fish -c "set --universal nvm_default_version $nodejs_version"
if fish -c "which node" >/dev/null 2>&1; then
version=$(node --version)
echo "node is installed: $version"
else
echo "nodejs not found. installing."
fish -c "nvm install $nodejs_version"
fish -c "nvm use $nodejs_version"
fi