🧶
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wezterm and nvim files

Jordi Izquierdo 4de2d675

+311
+3
.gitignore
··· 1 + .DS_Store 2 + .direnv 3 + result
+1
README.md
··· 1 + # (ノ◕ヮ◕)ノ*:・゚✧dotfiles(⌒_⌒;) ♥
+62
config/nvim/nvim/init.lua
··· 1 + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 + if not vim.loop.fs_stat(lazypath) then 3 + vim.fn.system({ "git", "clone", "--filter=blob:none", 4 + "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) 5 + end 6 + vim.opt.rtp:prepend(lazypath) 7 + 8 + -- Import configuration from other .lua files 9 + require("editor") 10 + require("hotkeys") 11 + -- Lazyvim 12 + require("lazy").setup({ 13 + { 14 + "projekt0n/github-nvim-theme", 15 + name = "github_dark" 16 + }, 17 + { 18 + "nvim-tree/nvim-tree.lua", 19 + dependencies = { "nvim-tree/nvim-web-devicons" }, -- Icons for file types 20 + config = function() 21 + require("nvim-tree").setup() 22 + vim.keymap.set("n", "<C-b>", ":NvimTreeToggle<CR>") 23 + end 24 + }, 25 + { 26 + "nvim-telescope/telescope.nvim", 27 + dependencies = { 28 + "nvim-lua/plenary.nvim", 29 + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, 30 + }, 31 + config = function() 32 + local builtin = require("telescope.builtin") 33 + -- <leader>f groups all Telescope keybindings 34 + vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Find files" }) 35 + vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Live grep" }) 36 + vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Buffers" }) 37 + vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Help tags" }) 38 + end 39 + }, 40 + { 41 + "nvim-treesitter/nvim-treesitter", 42 + build = ":TSUpdate", -- Updates parsers after install 43 + config = function() 44 + require("nvim-treesitter.configs").setup { 45 + ensure_installed = { "lua", "json", "yaml", "markdown", "html", "css", "javascript", "typescript", "go" }, 46 + highlight = { enable = true }, 47 + } 48 + end 49 + }, 50 + { 51 + "nvim-lualine/lualine.nvim", 52 + dependencies = { "nvim-tree/nvim-web-devicons" }, 53 + config = function() 54 + require("lualine").setup({ options = { theme = "github_dark" } }) 55 + end 56 + }, 57 + { 58 + import = "plugins" -- Import lua/plugins configuration 59 + }, 60 + }, { 61 + rocks = { enabled = false }, -- Avoids healthcheck warnings 62 + })
+22
config/nvim/nvim/lua/editor.lua
··· 1 + -- Leader key 2 + vim.g.mapleader = " " 3 + vim.g.maplocalleader = " " 4 + 5 + -- Fancy numbers vim style 6 + vim.opt.number = true 7 + vim.opt.relativenumber = true 8 + 9 + -- Indentation 10 + vim.opt.tabstop = 2 11 + vim.opt.shiftwidth = 2 12 + vim.opt.expandtab = true 13 + 14 + -- Highlight search 15 + vim.opt.hlsearch = true 16 + 17 + -- Other 18 + vim.opt.scrolloff = 8 19 + vim.opt.termguicolors = true 20 + 21 + -- Use system clipboard 22 + vim.opt.clipboard = "unnamedplus"
+51
config/nvim/nvim/lua/hotkeys.lua
··· 1 + -- For OSX 2 + -- <A-x> Option 3 + -- <C-x> Ctrl 4 + -- <S-x> Shift 5 + 6 + -- Cancel whatever you're doing with Esc 7 + vim.keymap.set("n", "<Esc>", ":noh<CR>") 8 + 9 + -- Edit init.lua 10 + vim.keymap.set("n", "<leader>i", ":e $MYVIMRC<CR>", { desc = "Edit config file" }) 11 + 12 + -- <leader>l groups all LSP keybindings 13 + vim.keymap.set("n", "<leader>lf", vim.lsp.buf.format, { desc = "Format code" }) 14 + vim.keymap.set("n", "<leader>ld", vim.lsp.buf.definition, { desc = "Go to definition" }) 15 + vim.keymap.set("n", "<leader>li", vim.lsp.buf.implementation, { desc = "Go to implementation" }) 16 + vim.keymap.set("n", "<leader>lr", vim.lsp.buf.rename, { desc = "Rename symbol" }) 17 + vim.keymap.set("n", "<leader>la", vim.lsp.buf.code_action, { desc = "Code actions" }) 18 + vim.keymap.set("n", "<leader>lh", vim.lsp.buf.hover, { desc = "Hover documentation" }) 19 + vim.keymap.set("n", "<leader>lR", vim.lsp.buf.references, { desc = "Find references" }) 20 + 21 + -- Undo/Redo (shift pattern: lowercase undo, uppercase redo) 22 + vim.keymap.set("n", "u", ":undo<CR>", { desc = "Undo" }) 23 + vim.keymap.set("n", "U", ":redo<CR>", { desc = "Redo" }) 24 + 25 + -- Ctrl commands (Save, new file...) 26 + vim.keymap.set("n", "<C-s>", ":w<CR>") 27 + vim.keymap.set("n", "<C-n>", ":enew<CR>") 28 + 29 + -- Move lines up/down like in VSCode 30 + vim.keymap.set("n", "<A-Up>", "<cmd>m .-2<cr>==", { desc = "Move line up" }) 31 + vim.keymap.set("n", "<A-Down>", "<cmd>m .+1<cr>==", { desc = "Move line down" }) 32 + vim.keymap.set("v", "<A-Up>", ":m '<-2<cr>gv=gv", { desc = "Move selection up" }) 33 + vim.keymap.set("v", "<A-Down>", ":m '>+1<cr>gv=gv", { desc = "Move selection down" }) 34 + 35 + -- Move start/end word with arrow keys 36 + vim.keymap.set("n", "<A-Left>", "b", { desc = "Move to previous word" }) 37 + vim.keymap.set("n", "<A-Right>", "e", { desc = "Move to next word" }) 38 + vim.keymap.set("v", "<A-Left>", "b", { desc = "Extend selection to prev word" }) 39 + vim.keymap.set("v", "<A-Right>", "e", { desc = "Extend selection to next word" }) 40 + vim.keymap.set("i", "<A-Left>", "<C-o>b", { desc = "Move to previous word" }) 41 + vim.keymap.set("i", "<A-Right>", "<C-o>e<Right>", { desc = "Move to next word" }) 42 + 43 + -- Use shift to start Visual mode 44 + vim.keymap.set('n', '<S-Left>', 'vh', { desc = 'Visual select left' }) 45 + vim.keymap.set('n', '<S-Right>', 'vl', { desc = 'Visual select right' }) 46 + vim.keymap.set('n', '<S-Up>', 'vk', { desc = 'Visual select up' }) 47 + vim.keymap.set('n', '<S-Down>', 'vj', { desc = 'Visual select down' }) 48 + vim.keymap.set('v', '<S-Left>', 'h', { desc = 'Extend selection left' }) 49 + vim.keymap.set('v', '<S-Right>', 'l', { desc = 'Extend selection right' }) 50 + vim.keymap.set('v', '<S-Up>', 'k', { desc = 'Extend selection up' }) 51 + vim.keymap.set('v', '<S-Down>', 'j', { desc = 'Extend selection down' })
+47
config/nvim/nvim/lua/plugins/lsp.lua
··· 1 + return { 2 + { 3 + "hrsh7th/nvim-cmp", 4 + dependencies = { 5 + "hrsh7th/cmp-nvim-lsp", -- LSP completion source 6 + "hrsh7th/cmp-buffer", -- Buffer words 7 + "hrsh7th/cmp-path", -- File paths 8 + "L3MON4D3/LuaSnip", -- Snippet engine (required by nvim-cmp) 9 + "saadparwaiz1/cmp_luasnip", -- Snippet completion source 10 + }, 11 + config = function() 12 + local cmp = require("cmp") 13 + cmp.setup({ 14 + snippet = { expand = function(args) require("luasnip").lsp_expand(args.body) end }, 15 + mapping = cmp.mapping.preset.insert({ 16 + ["<C-Space>"] = cmp.mapping.complete(), 17 + ["<CR>"] = cmp.mapping.confirm({ select = true }), 18 + ["<Tab>"] = cmp.mapping.select_next_item(), 19 + ["<S-Tab>"] = cmp.mapping.select_prev_item(), 20 + }), 21 + sources = { 22 + { name = "nvim_lsp" }, 23 + { name = "luasnip" }, 24 + { name = "buffer" }, 25 + { name = "path" }, 26 + }, 27 + }) 28 + end, 29 + }, 30 + { 31 + "williamboman/mason.nvim", -- LSP installer UI 32 + dependencies = { 33 + "j-hui/fidget.nvim", -- Shows LSP loading status 34 + }, 35 + config = function() 36 + local capabilities = require("cmp_nvim_lsp").default_capabilities() 37 + 38 + require("mason").setup() 39 + require("fidget").setup() 40 + 41 + vim.lsp.config("ts_ls", { capabilities = capabilities }) 42 + vim.lsp.config("gopls", { capabilities = capabilities }) 43 + vim.lsp.config("lua_ls", { capabilities = capabilities }) 44 + vim.lsp.enable({ "ts_ls", "gopls", "lua_ls" }) 45 + end, 46 + }, 47 + }
+13
config/nvim/nvim/lua/plugins/which-key.lua
··· 1 + return { 2 + { 3 + "folke/which-key.nvim", -- Shows keybinding hints after pressing leader 4 + dependencies = { "nvim-tree/nvim-web-devicons", "echasnovski/mini.icons" }, 5 + config = function() 6 + vim.o.timeout = true 7 + vim.o.timeoutlen = 300 8 + require("which-key").setup({ 9 + preset = "helix", 10 + }) 11 + end, 12 + }, 13 + }
+112
config/wezterm/wezterm.lua
··· 1 + -- ALT, OPT, META - these are all equivalent to the OSX Option key 2 + 3 + local wezterm = require 'wezterm' 4 + local config = wezterm.config_builder() 5 + 6 + -- Run fish on start 7 + config.default_prog = { '/opt/homebrew/bin/fish', '-l' } 8 + 9 + -- Hotkeys 10 + -- Leader is used for splitting the pane only 11 + config.leader = { 12 + key = 'k', 13 + mods = 'OPT', 14 + timeout_milliseconds = 1000 15 + } 16 + config.keys = { 17 + -- Key fixes to keep using the symbols written in my keyboard (spanish one) 18 + { 19 + key = "º", 20 + mods = "OPT", 21 + action = wezterm.action { SendString = "\\" }, 22 + }, 23 + { 24 + key = "1", 25 + mods = "OPT", 26 + action = wezterm.action { SendString = "|" }, 27 + }, 28 + { 29 + key = "2", 30 + mods = "OPT", 31 + action = wezterm.action { SendString = "@" }, 32 + }, 33 + { 34 + key = "3", 35 + mods = "OPT", 36 + action = wezterm.action { SendString = "#" }, 37 + }, 38 + { 39 + key = "4", 40 + mods = "OPT", 41 + action = wezterm.action { SendString = "~" }, 42 + }, 43 + { 44 + key = '+', 45 + mods = 'OPT', 46 + action = wezterm.action { SendString = "]" }, 47 + }, 48 + { 49 + key = 'ç', 50 + mods = 'OPT', 51 + action = wezterm.action { SendString = "}" }, 52 + }, 53 + -- Window splitting 54 + { 55 + key = '1', -- OPT + 1 = '|' 56 + mods = 'LEADER|OPT', 57 + action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' }, 58 + }, 59 + { 60 + key = '-', 61 + mods = 'LEADER', 62 + action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' }, 63 + }, 64 + -- Move between panes  65 + { 66 + key = 'LeftArrow', 67 + mods = 'CMD|OPT', 68 + action = wezterm.action.ActivatePaneDirection('Left'), 69 + }, 70 + { 71 + key = 'RightArrow', 72 + mods = 'CMD|OPT', 73 + action = wezterm.action.ActivatePaneDirection('Right'), 74 + }, 75 + { 76 + key = 'UpArrow', 77 + mods = 'CMD|OPT', 78 + action = wezterm.action.ActivatePaneDirection('Up'), 79 + }, 80 + { 81 + key = 'DownArrow', 82 + mods = 'CMD|OPT', 83 + action = wezterm.action.ActivatePaneDirection('Down'), 84 + }, 85 + -- Clear screen 86 + { 87 + key = 'l', 88 + mods = 'OPT', 89 + action = wezterm.action.ClearScrollback 'ScrollbackAndViewport', 90 + } 91 + } 92 + 93 + -- Aesthetics 94 + config.color_scheme = 'SleepyHollow' 95 + config.font_size = 14.0 96 + config.font = wezterm.font_with_fallback { 97 + 'Berkeley Mono', 98 + } 99 + 100 + config.skip_close_confirmation_for_processes_named = { 101 + 'bash', 102 + 'sh', 103 + 'zsh', 104 + -- 'fish', // Ask to confirm when close panes! 105 + 'tmux', 106 + 'nu', 107 + 'cmd.exe', 108 + 'pwsh.exe', 109 + 'powershell.exe', 110 + } 111 + 112 + return config