first commit
This commit is contained in:
@@ -0,0 +1,50 @@
|
|||||||
|
# Zsh / tmux / Neovim setup
|
||||||
|
|
||||||
|
This directory holds dotfiles and an installer that targets **Debian/Ubuntu** (APT + `sudo`).
|
||||||
|
|
||||||
|
## Run the installer
|
||||||
|
|
||||||
|
From this repository, run the script **from the `zsh` directory** so the `cp` steps resolve `init.lua`, `p10k.zsh`, `tmux.conf`, and `tmuxinator.yml`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd zsh
|
||||||
|
bash install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
## What `install.sh` does
|
||||||
|
|
||||||
|
1. **System packages** — `apt-get update` / `upgrade`, then installs: `zsh`, `tmux`, `wget`, `curl`, `git`, `vim`, `nmon`, `neofetch`, `nload`, `htop`.
|
||||||
|
|
||||||
|
2. **Oh My Zsh** — If `${ZSH:-~/.oh-my-zsh}` is not already a directory, runs the official install script from [ohmyzsh](https://github.com/ohmyzsh/ohmyzsh) with `CHSH=no` and `RUNZSH=no` (non-interactive). Otherwise prints a skip message. Uses `env -u ZSH` so a pre-exported `ZSH` does not confuse the installer.
|
||||||
|
|
||||||
|
3. **Zsh plugins** — Clones [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) and [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) into `$ZSH_CUSTOM/plugins/`, then edits `~/.zshrc` so the `plugins=(...)` line includes `zsh-autosuggestions` and `zsh-syntax-highlighting`.
|
||||||
|
|
||||||
|
4. **Powerlevel10k** — Clones [powerlevel10k](https://github.com/romkatv/powerlevel10k) under `$ZSH_CUSTOM` (see `install.sh` for the exact path).
|
||||||
|
|
||||||
|
5. **Tmux Plugin Manager (TPM)** — Clones [tpm](https://github.com/tmux-plugins/tpm) to `~/.tmux/plugins/tpm`.
|
||||||
|
|
||||||
|
6. **Neovim** — Downloads the latest **Linux x86_64 AppImage** from the Neovim releases, installs it as `/usr/local/bin/nvim`.
|
||||||
|
|
||||||
|
7. **Tmuxinator** — Installs the Zsh completion file to `/usr/local/share/zsh/site-functions/_tmuxinator`, and appends `alias mux=tmuxinator` to `~/.zshrc` when that exact line is not already present.
|
||||||
|
|
||||||
|
8. **Local configs** — Copies repo files into your home/config:
|
||||||
|
|
||||||
|
| Source (this repo) | Destination |
|
||||||
|
| ------------------ | ----------- |
|
||||||
|
| `init.lua` | `~/.config/nvim/init.lua` |
|
||||||
|
| `p10k.zsh` | `~/.p10k.zsh` |
|
||||||
|
| `tmux.conf` | `~/.tmux.conf` |
|
||||||
|
| `tmuxinator.yml` | `~/.tmuxinator/project.yml` |
|
||||||
|
|
||||||
|
9. **Default shell** — Runs `sudo chsh -s "$(command -v zsh)"` for the invoking user (`SUDO_USER` when the script was started with `sudo`), so new login sessions use zsh without running interactive `chsh`.
|
||||||
|
|
||||||
|
## After install
|
||||||
|
|
||||||
|
- **New login shell:** Log out and back in (or open a new SSH session) so the `chsh` change applies. Until then you can run `exec zsh` in the current terminal.
|
||||||
|
- In tmux, install TPM plugins per your `tmux.conf` (often `prefix` + `I` once TPM is loaded).
|
||||||
|
|
||||||
|
If `sudo chsh` failed (e.g. zsh not listed in `/etc/shells`), set the shell manually after fixing: `chsh -s "$(command -v zsh)"`.
|
||||||
|
|
||||||
|
## Further reading
|
||||||
|
|
||||||
|
- Tmux-oriented setup notes: [Terminal setup with zsh, tmux, Dracula theme](https://dev.to/andrenbrandao/terminal-setup-with-zsh-tmux-dracula-theme-48lm)
|
||||||
@@ -0,0 +1,506 @@
|
|||||||
|
-- ~/.config/nvim/init.lua
|
||||||
|
-- Full IDE setup for Neovim 0.12+
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Options
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = " "
|
||||||
|
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.mouse = "a"
|
||||||
|
vim.opt.showmode = false -- shown in statusline instead
|
||||||
|
vim.opt.clipboard = "unnamedplus"
|
||||||
|
vim.opt.breakindent = true
|
||||||
|
vim.opt.undofile = true
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
vim.opt.signcolumn = "yes"
|
||||||
|
vim.opt.updatetime = 250
|
||||||
|
vim.opt.timeoutlen = 300
|
||||||
|
vim.opt.splitright = true
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.scrolloff = 10
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
vim.opt.wrap = false
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
vim.opt.completeopt = "menu,menuone,noselect"
|
||||||
|
|
||||||
|
-- Disable netrw (using nvim-tree instead)
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Bootstrap lazy.nvim
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
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)
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Plugins
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
require("lazy").setup({
|
||||||
|
|
||||||
|
-- Theme
|
||||||
|
{
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
priority = 1000,
|
||||||
|
opts = { flavour = "mocha", transparent_background = true },
|
||||||
|
config = function(_, opts)
|
||||||
|
require("catppuccin").setup(opts)
|
||||||
|
vim.cmd.colorscheme("catppuccin")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Statusline
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
opts = {
|
||||||
|
options = { theme = "catppuccin" },
|
||||||
|
sections = {
|
||||||
|
lualine_c = { { "filename", path = 1 } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Bufferline (tabs)
|
||||||
|
{
|
||||||
|
"akinsho/bufferline.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
|
offsets = { { filetype = "NvimTree", text = "Explorer", highlight = "Directory" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- File explorer
|
||||||
|
{
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
opts = {
|
||||||
|
sort = { sorter = "case_sensitive" },
|
||||||
|
view = { width = 35 },
|
||||||
|
renderer = { group_empty = true },
|
||||||
|
filters = { dotfiles = false },
|
||||||
|
git = { enable = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Fuzzy finder
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
branch = "0.1.x",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local telescope = require("telescope")
|
||||||
|
telescope.setup({
|
||||||
|
defaults = {
|
||||||
|
file_ignore_patterns = { "node_modules", ".git/", "target/" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
pcall(telescope.load_extension, "fzf")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Treesitter (syntax highlighting, text objects, etc.)
|
||||||
|
-- Note: Nvim 0.12 has built-in treesitter; this plugin adds :TSInstall and auto-install
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
config = function()
|
||||||
|
-- Auto-install parsers when entering a buffer
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
callback = function()
|
||||||
|
pcall(vim.treesitter.start)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
-- Install parsers via :TSInstall or run this once:
|
||||||
|
local ensure = {
|
||||||
|
"lua", "rust", "python", "typescript", "javascript", "tsx",
|
||||||
|
"json", "yaml", "toml", "html", "css", "bash", "markdown",
|
||||||
|
"markdown_inline", "c", "cpp", "go", "dockerfile", "gitcommit",
|
||||||
|
}
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "LazyDone",
|
||||||
|
once = true,
|
||||||
|
callback = function()
|
||||||
|
local installed = require("nvim-treesitter.install")
|
||||||
|
for _, lang in ipairs(ensure) do
|
||||||
|
pcall(installed.install, lang)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Mason: portable LSP/formatter/linter installer
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Autocompletion
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||||
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||||
|
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
}),
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Formatting
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
event = "BufWritePre",
|
||||||
|
cmd = { "ConformInfo" },
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
python = { "ruff_format" },
|
||||||
|
rust = { "rustfmt" },
|
||||||
|
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
typescript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
json = { "prettierd", "prettier", stop_after_first = true },
|
||||||
|
},
|
||||||
|
format_on_save = {
|
||||||
|
timeout_ms = 3000,
|
||||||
|
lsp_format = "fallback",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Git signs in gutter
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
opts = {
|
||||||
|
signs = {
|
||||||
|
add = { text = "+" },
|
||||||
|
change = { text = "~" },
|
||||||
|
delete = { text = "_" },
|
||||||
|
topdelete = { text = "-" },
|
||||||
|
changedelete = { text = "~" },
|
||||||
|
},
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local gs = package.loaded.gitsigns
|
||||||
|
local function map(mode, l, r, desc)
|
||||||
|
vim.keymap.set(mode, l, r, { buffer = bufnr, desc = desc })
|
||||||
|
end
|
||||||
|
map("n", "]h", gs.next_hunk, "Next hunk")
|
||||||
|
map("n", "[h", gs.prev_hunk, "Prev hunk")
|
||||||
|
map("n", "<leader>hs", gs.stage_hunk, "Stage hunk")
|
||||||
|
map("n", "<leader>hr", gs.reset_hunk, "Reset hunk")
|
||||||
|
map("n", "<leader>hp", gs.preview_hunk, "Preview hunk")
|
||||||
|
map("n", "<leader>hb", function() gs.blame_line({ full = true }) end, "Blame line")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Diagnostics list
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
cmd = "Trouble",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Terminal
|
||||||
|
{
|
||||||
|
"akinsho/toggleterm.nvim",
|
||||||
|
version = "*",
|
||||||
|
opts = {
|
||||||
|
size = function(term)
|
||||||
|
if term.direction == "horizontal" then return 15
|
||||||
|
elseif term.direction == "vertical" then return vim.o.columns * 0.4
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
open_mapping = [[<C-\>]],
|
||||||
|
direction = "horizontal",
|
||||||
|
shade_terminals = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Autopairs
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
event = "InsertEnter",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Comment toggling
|
||||||
|
{
|
||||||
|
"numToStr/Comment.nvim",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Indent guides
|
||||||
|
{
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
main = "ibl",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Which-key (keybinding hints)
|
||||||
|
{
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Surround
|
||||||
|
{
|
||||||
|
"kylechui/nvim-surround",
|
||||||
|
version = "*",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Better UI for messages, cmdline, popupmenu
|
||||||
|
{
|
||||||
|
"folke/noice.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
dependencies = { "MunifTanjim/nui.nvim" },
|
||||||
|
opts = {
|
||||||
|
lsp = {
|
||||||
|
override = {
|
||||||
|
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||||
|
["vim.lsp.util.stylize_markdown"] = true,
|
||||||
|
["cmp.entry.get_documentation"] = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
presets = {
|
||||||
|
bottom_search = true,
|
||||||
|
command_palette = true,
|
||||||
|
long_message_to_split = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Dashboard
|
||||||
|
{
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
config = function()
|
||||||
|
require("alpha").setup(require("alpha.themes.startify").config)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Lazygit integration
|
||||||
|
{
|
||||||
|
"kdheepak/lazygit.nvim",
|
||||||
|
cmd = "LazyGit",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Todo comments highlighting
|
||||||
|
{
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
}, {
|
||||||
|
ui = { border = "rounded" },
|
||||||
|
checker = { enabled = true, notify = false },
|
||||||
|
})
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Native LSP (Nvim 0.11+)
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Enhance LSP capabilities with nvim-cmp
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
-- Rust (rust-analyzer)
|
||||||
|
vim.lsp.config("rust_analyzer", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
checkOnSave = { command = "clippy" },
|
||||||
|
cargo = { allFeatures = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- TypeScript/JavaScript
|
||||||
|
vim.lsp.config("ts_ls", { capabilities = capabilities })
|
||||||
|
|
||||||
|
-- Python
|
||||||
|
vim.lsp.config("pyright", { capabilities = capabilities })
|
||||||
|
|
||||||
|
-- Lua
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = { globals = { "vim" } },
|
||||||
|
workspace = { checkThirdParty = false },
|
||||||
|
telemetry = { enable = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- C/C++
|
||||||
|
vim.lsp.config("clangd", { capabilities = capabilities })
|
||||||
|
|
||||||
|
-- Go
|
||||||
|
vim.lsp.config("gopls", { capabilities = capabilities })
|
||||||
|
|
||||||
|
-- Enable LSP servers (they activate when a matching filetype opens)
|
||||||
|
vim.lsp.enable("rust_analyzer")
|
||||||
|
vim.lsp.enable("ts_ls")
|
||||||
|
vim.lsp.enable("pyright")
|
||||||
|
vim.lsp.enable("lua_ls")
|
||||||
|
vim.lsp.enable("clangd")
|
||||||
|
vim.lsp.enable("gopls")
|
||||||
|
|
||||||
|
-- Diagnostic display
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = { prefix = "~" },
|
||||||
|
signs = true,
|
||||||
|
underline = true,
|
||||||
|
update_in_insert = false,
|
||||||
|
severity_sort = true,
|
||||||
|
float = { border = "rounded", source = true },
|
||||||
|
})
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
-- Keymaps
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
-- General
|
||||||
|
map("n", "<Esc>", "<cmd>nohlsearch<CR>", { desc = "Clear search highlight" })
|
||||||
|
map("n", "<leader>w", "<cmd>w<CR>", { desc = "Save" })
|
||||||
|
map("n", "<leader>q", "<cmd>q<CR>", { desc = "Quit" })
|
||||||
|
|
||||||
|
-- Better window navigation
|
||||||
|
map("n", "<C-h>", "<C-w>h", { desc = "Move to left window" })
|
||||||
|
map("n", "<C-j>", "<C-w>j", { desc = "Move to lower window" })
|
||||||
|
map("n", "<C-k>", "<C-w>k", { desc = "Move to upper window" })
|
||||||
|
map("n", "<C-l>", "<C-w>l", { desc = "Move to right window" })
|
||||||
|
|
||||||
|
-- Buffer navigation
|
||||||
|
map("n", "<S-l>", "<cmd>bnext<CR>", { desc = "Next buffer" })
|
||||||
|
map("n", "<S-h>", "<cmd>bprevious<CR>", { desc = "Prev buffer" })
|
||||||
|
map("n", "<leader>bd", "<cmd>bdelete<CR>", { desc = "Delete buffer" })
|
||||||
|
|
||||||
|
-- Move lines up/down in visual mode
|
||||||
|
map("v", "J", ":m '>+1<CR>gv=gv", { desc = "Move selection down" })
|
||||||
|
map("v", "K", ":m '<-2<CR>gv=gv", { desc = "Move selection up" })
|
||||||
|
|
||||||
|
-- Stay centered when scrolling
|
||||||
|
map("n", "<C-d>", "<C-d>zz")
|
||||||
|
map("n", "<C-u>", "<C-u>zz")
|
||||||
|
|
||||||
|
-- File explorer
|
||||||
|
map("n", "<leader>e", "<cmd>NvimTreeToggle<CR>", { desc = "Toggle explorer" })
|
||||||
|
map("n", "<leader>o", "<cmd>NvimTreeFocus<CR>", { desc = "Focus explorer" })
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
map("n", "<leader>ff", "<cmd>Telescope find_files<CR>", { desc = "Find files" })
|
||||||
|
map("n", "<leader>fg", "<cmd>Telescope live_grep<CR>", { desc = "Live grep" })
|
||||||
|
map("n", "<leader>fb", "<cmd>Telescope buffers<CR>", { desc = "Buffers" })
|
||||||
|
map("n", "<leader>fh", "<cmd>Telescope help_tags<CR>", { desc = "Help tags" })
|
||||||
|
map("n", "<leader>fr", "<cmd>Telescope oldfiles<CR>", { desc = "Recent files" })
|
||||||
|
map("n", "<leader>fs", "<cmd>Telescope lsp_document_symbols<CR>", { desc = "Document symbols" })
|
||||||
|
map("n", "<leader>fw", "<cmd>Telescope lsp_workspace_symbols<CR>", { desc = "Workspace symbols" })
|
||||||
|
map("n", "<leader>fd", "<cmd>Telescope diagnostics<CR>", { desc = "Diagnostics" })
|
||||||
|
|
||||||
|
-- LSP (set on attach)
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
callback = function(ev)
|
||||||
|
local opts = { buffer = ev.buf }
|
||||||
|
map("n", "gd", vim.lsp.buf.definition, vim.tbl_extend("force", opts, { desc = "Go to definition" }))
|
||||||
|
map("n", "gD", vim.lsp.buf.declaration, vim.tbl_extend("force", opts, { desc = "Go to declaration" }))
|
||||||
|
map("n", "gi", vim.lsp.buf.implementation, vim.tbl_extend("force", opts, { desc = "Go to implementation" }))
|
||||||
|
map("n", "gt", vim.lsp.buf.type_definition, vim.tbl_extend("force", opts, { desc = "Type definition" }))
|
||||||
|
map("n", "gr", vim.lsp.buf.references, vim.tbl_extend("force", opts, { desc = "References" }))
|
||||||
|
map("n", "K", vim.lsp.buf.hover, vim.tbl_extend("force", opts, { desc = "Hover docs" }))
|
||||||
|
map("n", "<leader>rn", vim.lsp.buf.rename, vim.tbl_extend("force", opts, { desc = "Rename" }))
|
||||||
|
map("n", "<leader>ca", vim.lsp.buf.code_action, vim.tbl_extend("force", opts, { desc = "Code action" }))
|
||||||
|
map("i", "<C-k>", vim.lsp.buf.signature_help, vim.tbl_extend("force", opts, { desc = "Signature help" }))
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Diagnostics
|
||||||
|
map("n", "[d", vim.diagnostic.goto_prev, { desc = "Prev diagnostic" })
|
||||||
|
map("n", "]d", vim.diagnostic.goto_next, { desc = "Next diagnostic" })
|
||||||
|
map("n", "<leader>dl", vim.diagnostic.open_float, { desc = "Diagnostic float" })
|
||||||
|
map("n", "<leader>dd", "<cmd>Trouble diagnostics toggle<CR>", { desc = "Trouble diagnostics" })
|
||||||
|
|
||||||
|
-- Git
|
||||||
|
map("n", "<leader>gg", "<cmd>LazyGit<CR>", { desc = "LazyGit" })
|
||||||
|
|
||||||
|
-- Terminal
|
||||||
|
map("n", "<leader>th", "<cmd>ToggleTerm direction=horizontal<CR>", { desc = "Terminal horizontal" })
|
||||||
|
map("n", "<leader>tv", "<cmd>ToggleTerm direction=vertical<CR>", { desc = "Terminal vertical" })
|
||||||
|
map("n", "<leader>tf", "<cmd>ToggleTerm direction=float<CR>", { desc = "Terminal float" })
|
||||||
|
map("t", "<Esc><Esc>", [[<C-\><C-n>]], { desc = "Exit terminal mode" })
|
||||||
Executable
+54
@@ -0,0 +1,54 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Debian/Ubuntu bootstrap for zsh, tmux, Neovim, and related dotfiles.
|
||||||
|
# Run from this directory (zsh/) so the cp paths below resolve.
|
||||||
|
|
||||||
|
# APT: refresh index, upgrade, and install CLI dependencies
|
||||||
|
sudo apt-get update -y && sudo apt-get upgrade -y
|
||||||
|
sudo apt-get install -y zsh tmux wget curl git vim nmon neofetch nload htop
|
||||||
|
|
||||||
|
# Oh My Zsh: skip if already present; env -u ZSH avoids installer errors when ZSH is exported from a login shell
|
||||||
|
_omz_dir="${ZSH:-$HOME/.oh-my-zsh}"
|
||||||
|
if [ ! -d "$_omz_dir" ]; then
|
||||||
|
CHSH=no RUNZSH=no env -u ZSH sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||||
|
else
|
||||||
|
echo "Oh My Zsh already installed at $_omz_dir, skipping."
|
||||||
|
fi
|
||||||
|
ZSH_CUSTOM="${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"
|
||||||
|
|
||||||
|
# Zsh plugins + enable them in ~/.zshrc
|
||||||
|
git clone https://github.com/zsh-users/zsh-autosuggestions.git "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
|
||||||
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
|
||||||
|
sed -i 's|(git)|(git zsh-autosuggestions zsh-syntax-highlighting)|' ~/.zshrc
|
||||||
|
|
||||||
|
# Powerlevel10k theme
|
||||||
|
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "$ZSH_CUSTOM/themes/powerlevel10k"
|
||||||
|
|
||||||
|
# Tmux Plugin Manager
|
||||||
|
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
||||||
|
|
||||||
|
# Neovim: latest Linux x86_64 AppImage -> /usr/local/bin/nvim
|
||||||
|
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.appimage
|
||||||
|
chmod +x nvim-linux-x86_64.appimage
|
||||||
|
sudo mv nvim-linux-x86_64.appimage /usr/local/bin/nvim
|
||||||
|
|
||||||
|
# Tmuxinator Zsh completion
|
||||||
|
sudo mkdir -p /usr/local/share/zsh/site-functions
|
||||||
|
sudo wget https://raw.githubusercontent.com/tmuxinator/tmuxinator/master/completion/tmuxinator.zsh -O /usr/local/share/zsh/site-functions/_tmuxinator
|
||||||
|
|
||||||
|
# Tmuxinator alias in ~/.zshrc (skip if already present)
|
||||||
|
if ! grep -qxF 'alias mux=tmuxinator' ~/.zshrc 2>/dev/null; then
|
||||||
|
printf '\n# tmuxinator\nalias mux=tmuxinator\n' >> ~/.zshrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Dotfiles from this repo (paths relative to cwd)
|
||||||
|
mkdir -p ~/.config/nvim/ ~/.tmuxinator/
|
||||||
|
cp init.lua ~/.config/nvim/init.lua
|
||||||
|
cp p10k.zsh ~/.p10k.zsh
|
||||||
|
cp tmux.conf ~/.tmux.conf
|
||||||
|
cp tmuxinator.yml ~/.tmuxinator/project.yml
|
||||||
|
|
||||||
|
# Login shell -> zsh for the next session. Uses sudo chsh (not interactive `chsh`),
|
||||||
|
# so it typically only prompts if sudo is not already cached from the steps above.
|
||||||
|
_chsh_user="${SUDO_USER:-$USER}"
|
||||||
|
echo "Changing shell to zsh for $_chsh_user"
|
||||||
|
sudo chsh -s "$(command -v zsh)" "$_chsh_user"
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
## Install zsh && oh-my-zsh && autosuggestion && syntax-highlighting plugins && powerlevel10k theme
|
||||||
|
|
||||||
|
`sudo apt-get install zsh -y`
|
||||||
|
|
||||||
|
`sudo curl -L http://install.ohmyz.sh | sh`
|
||||||
|
|
||||||
|
`zsh`
|
||||||
|
|
||||||
|
`chsh -s $(which zsh)`
|
||||||
|
|
||||||
|
`git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions`
|
||||||
|
|
||||||
|
`git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting`
|
||||||
|
|
||||||
|
`git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k`
|
||||||
|
|
||||||
|
replace .zshrc to ~/.zshrc, .p10k.zsh to ~/.p10k.zsh
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
unbind-key C-b
|
||||||
|
set-option -g prefix C-a
|
||||||
|
bind-key C-a send-prefix
|
||||||
|
set -g default-terminal "screen-256color"
|
||||||
|
|
||||||
|
# List of plugins
|
||||||
|
set -g @plugin 'tmux-plugins/tpm'
|
||||||
|
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||||
|
set -g @plugin 'dracula/tmux'
|
||||||
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||||
|
set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||||
|
|
||||||
|
# Set 256 colors
|
||||||
|
set -s default-terminal 'tmux-256color'
|
||||||
|
|
||||||
|
# Other examples:
|
||||||
|
# set -g @plugin 'github_username/plugin_name'
|
||||||
|
# set -g @plugin '[email protected]:user/plugin'
|
||||||
|
# set -g @plugin '[email protected]:user/plugin'
|
||||||
|
|
||||||
|
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||||
|
run '~/.tmux/plugins/tpm/tpm'
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
name: project
|
||||||
|
root: ~/
|
||||||
|
windows:
|
||||||
|
- data:
|
||||||
|
layout: main-vertical
|
||||||
|
# Synchronize all panes of this window, can be enabled before or after the pane commands run.
|
||||||
|
# 'before' represents legacy functionality and will be deprecated in a future release, in favour of 'after'
|
||||||
|
# synchronize: after
|
||||||
|
panes:
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- monitor:
|
||||||
|
layout: main-vertical
|
||||||
|
# synchronize: after
|
||||||
|
panes:
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- vn:
|
||||||
|
layout: even-horizontal
|
||||||
|
synchronize: after
|
||||||
|
panes:
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- null
|
||||||
|
- sgp:
|
||||||
|
layout: even-horizontal
|
||||||
|
synchronize: after
|
||||||
|
panes:
|
||||||
|
- null
|
||||||
|
- null
|
||||||
Reference in New Issue
Block a user