feat: lazyload all the things

This commit is contained in:
max_richter 2022-10-24 15:24:37 +02:00
parent 44ff742f4c
commit 79c088ba97
17 changed files with 462 additions and 246 deletions

View File

@ -6,6 +6,13 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
if [ -d "$HOME/.asdf" ] ; then
. "$HOME/.asdf/asdf.sh"
fi
# Enable vim mode in zsh
bindkey -v
ZSH_THEME="powerlevel10k/powerlevel10k"
# ZSH_TMUX_AUTOSTART=true
ZSH_TMUX_AUTOCONNECT=false
@ -13,8 +20,9 @@ ZSH_TMUX_AUTOCONNECT=false
plugins=(
git
docker
tmux
asdf
tmux
nx-completion
zsh-autosuggestions
)
@ -60,9 +68,6 @@ if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
if [ -d "$HOME/.asdf" ] ; then
. "$HOME/.asdf/asdf.sh"
fi
if type go &> /dev/null ; then
export PATH="$PATH:$(go env GOPATH)/bin"

View File

@ -1,7 +1,7 @@
-- Automatically close the goto definition buffer after leaving
local buffer_id = vim.api.nvim_win_get_buf(0)
vim.api.nvim_create_autocmd({ "bufwinleave", "bufleave" }, {
pattern = "*",
once = true,
command = "bdelete " .. buffer_id,
})
-- vim.api.nvim_create_autocmd({ "bufwinleave", "bufleave" }, {
-- pattern = "*",
-- once = true,
-- command = "bdelete " .. buffer_id,
-- })

View File

@ -7,17 +7,7 @@ require("core.autocommands")
require("core.theme")
require("core.keymappings")
require("configs.autocomplete")
require("configs.dashboard")
-- require("configs.dap")
require("configs.command-center")
require("configs.notify")
require("configs.lsp")
require("configs.telescope")
require("configs.tree")
require("configs.treesitter")
require("configs.autocomplete")
require("configs.neotest")
require("configs.snippets")
require("overlays")

View File

@ -1,17 +1,13 @@
-- luasnip setup
local luasnip = require("luasnip")
local lspkind = require("lspkind")
local cmp = require("cmp")
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
-- local tabnine = require("cmp_tabnine.config")
local source_mapping = {
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
cmp_tabnine = "[TN]",
path = "[Path]",
}
require("nvim-autopairs").setup()
require("copilot").setup()
require("copilot_cmp").setup()
cmp.setup({
window = {
@ -50,28 +46,21 @@ cmp.setup({
}),
},
formatting = {
format = function(entry, vim_item)
vim_item.kind = lspkind.presets.default[vim_item.kind]
local menu = source_mapping[entry.source.name]
if entry.source.name == "cmp_tabnine" then
if entry.completion_item.data ~= nil and entry.completion_item.data.detail ~= nil then
menu = entry.completion_item.data.detail .. " " .. menu
end
vim_item.kind = ""
end
vim_item.menu = menu
return vim_item
end,
format = lspkind.cmp_format({
mode = "symbol",
max_width = 50,
symbol_map = { Copilot = "" },
}),
},
sources = {
{ name = "copilot" },
{ name = "nvim_lua" },
{ name = "nvim_lsp" },
-- { name = "cmp_tabnine", max_item_count = 3 },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer", max_item_count = 3 },
{ name = "buffer" },
{ name = "calc" },
-- { name = 'copilot' }
},
})
@ -91,11 +80,4 @@ cmp.setup.cmdline(":", {
}),
})
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
-- Setup lspconfig.
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
require("lspconfig").html.setup({
capabilities = capabilities,
})
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))

View File

@ -1,20 +0,0 @@
local prettier = require("prettier")
prettier.setup({
bin = "prettier", -- or `prettierd`
filetypes = {
"css",
"graphql",
"html",
"svelte",
"javascript",
"javascriptreact",
"json",
"less",
"markdown",
"scss",
"typescript",
"typescriptreact",
"yaml",
},
})

View File

@ -12,7 +12,7 @@ end
local dashboard = require("alpha.themes.dashboard")
-- Remove These ~ ~ ~
vim.opt.fillchars:append { eob = " " }
vim.opt.fillchars:append({ eob = " " })
-- Disable Status Line so that alpha dashboard look nice
-- vim.cmd [[ au User AlphaReady if winnr('$') == 1 | set laststatus=1 ]]

View File

@ -74,7 +74,7 @@ lsp.sumneko_lua.setup({
},
})
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
local capabilities = require("cmp_nvim_lsp").default_capabilities();
capabilities.textDocument.completion.completionItem.snippetSupport = true
@ -173,10 +173,10 @@ lsp.rust_analyzer.setup({
},
})
-- lsp.remark_ls.setup {
-- filetypes = { "markdown" },
-- on_attach = on_attach
-- }
lsp.gopls.setup {
capabilities = capabilities,
on_attach = on_attach
}
lsp.ltex.setup({
capabilities = capabilities,

View File

@ -0,0 +1,4 @@
require('sniprun').setup({
selected_interpreters = { "JS_TS_deno" },
repl_enable = { "JS_TS_deno" }
})

View File

@ -1,9 +1,12 @@
local telescope = require("telescope")
local trouble = require("trouble.providers.telescope")
telescope.setup({
defaults = {},
})
local function open_with_trouble()
require("trouble.providers.telescope").open_with_trouble()
end
local default = {
defaults = {
vimgrep_arguments = {
@ -44,8 +47,8 @@ local default = {
winblend = 0,
border = {},
mappings = {
i = { ["<c-t>"] = trouble.open_with_trouble },
n = { ["<c-t>"] = trouble.open_with_trouble },
i = { ["<c-t>"] = open_with_trouble },
n = { ["<c-t>"] = open_with_trouble },
},
borderchars = { "", "", "", "", "", "", "", "" },
color_devicons = true,
@ -61,5 +64,5 @@ telescope.setup(default)
-- telescope.load_extension("themes");
--
telescope.load_extension("harpoon")
telescope.load_extension("command_center")
-- telescope.load_extension("command_center")
telescope.load_extension("notify")

View File

@ -1,22 +1,6 @@
-- local parser_configs = require("nvim-treesitter.parsers").get_parser_configs()
-- parser_configs.http = {
-- install_info = {
-- url = "https://github.com/NTBBloodbath/tree-sitter-http",
-- files = {"src/parser.c"},
-- branch = "main"
-- }
-- }
-- parser_configs.glsl = {
-- filetype = "vert",
-- filetypes = {"vert", "frag"}
-- }
--
require "nvim-treesitter.configs".setup {
require("nvim-treesitter.configs").setup({
indent = {
enable = true
enable = true,
},
ensure_installed = {
"bash",
@ -31,7 +15,45 @@ require "nvim-treesitter.configs".setup {
"go",
"lua",
"yaml",
"prisma"
"prisma",
},
highlight = { enable = true, disable = { "tsx" } }
}
highlight = { enable = true, disable = { "tsx" } },
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
-- You can choose the select mode (default is charwise 'v')
--
-- Can also be a function which gets passed a table with the keys
-- * query_string: eg '@function.inner'
-- * method: eg 'v' or 'o'
-- and should return the mode ('v', 'V', or '<c-v>') or a table
-- mapping query_strings to modes.
selection_modes = {
["@parameter.outer"] = "v", -- charwise
["@function.outer"] = "V", -- linewise
["@class.outer"] = "<c-v>", -- blockwise
},
-- If you set this to `true` (default is `false`) then any textobject is
-- extended to include preceding or succeeding whitespace. Succeeding
-- whitespace has priority in order to act similarly to eg the built-in
-- `ap`.
--
-- Can also be a function which gets passed a table with the keys
-- * query_string: eg '@function.inner'
-- * selection_mode: eg 'v'
-- and should return true of false
include_surrounding_whitespace = true,
},
},
})

View File

@ -3,23 +3,6 @@ local map = vim.keymap.set
local g = vim.g
local saga = require("lspsaga")
local truezen = require("true-zen")
truezen.setup({
ataraxis = {
minimum_writing_area = { -- minimum size of main window
width = 250,
height = 100,
},
padding = {
left = 10,
right = 10,
}
},
integrations = {
tmux = true, -- hide tmux status bar in (minimalist, ataraxis)
lualine = true, -- hide nvim-lualine (ataraxis)
},
})
saga.init_lsp_saga()
local options = { noremap = true, silent = true }
@ -29,7 +12,7 @@ g.mapleader = " "
map("n", "<C-o>", ":Telescope find_files<CR>", options)
map("n", "<C-f>", ":lua require'telescope.builtin'.live_grep{ cwd = vim.fn.getcwd() }<CR>", options)
map("n", "<C-p>", ":Telescope command_center<CR>", options)
-- map("n", "<C-p>", ":Telescope command_center<CR>", options)
map("n", "<Leader><Leader>", "za", remap)
-- LSP Functionality
@ -55,6 +38,9 @@ map("n", "<Leader>b", ":lua require('dap').toggle_breakpoint()", options)
map("n", "tt", ":lua require('neotest').run.run()<CR>", options)
map("n", "to", ":lua require('neotest').summary.open()<CR>", options)
map({ "n", "v" }, "+", "<cmd>:Boole increment<CR>", options)
map({ "n", "v" }, "-", "<cmd>:Boole decrement<CR>", options)
-- Navigate Buffers
map("n", "<C-h>", "<C-w>h", options)
map("n", "<C-j>", "<C-w>j", options)
@ -102,7 +88,6 @@ map("v", "<A-j>", ":m '>+1<CR>gv=gv", options)
map("v", "<A-k>", ":m '<-2<CR>gv=gv", options)
map("n", "<A-S-k>", "YP", options)
map("n", "<A-S-j>", "Yp", options)
map({ "v", "n" }, "z", truezen.ataraxis, options)
-- Faster git merge
map("n", "<Leader>gd", ":Gvdiffsplit!<CR>", options)
@ -123,6 +108,7 @@ map("n", "<Down>", ":echo 'No Down for you'<CR><dw>", options)
-- Run Requests
map("n", "<Leader>r", ":SnipRun<CR>", options)
map("v", "<Leader>r", ":'<,'>SnipRun<CR>", options)
-- Close on q
map("n", "<Leader>q", "<Esc>:q<CR>", options)

View File

@ -28,6 +28,10 @@ set.foldexpr = "nvim_treesitter#foldexpr()" -- use treesitter for folding
vim.wo.foldlevel = 99 -- feel free to decrease the value
vim.wo.foldenable = true
vim.cmd([[set wildmode=list:longest,full]]) -- Command-line completion mode
vim.cmd([[let loaded_netrw = 1]]) -- Command-line completion mode
vim.cmd([[let loaded_netrwPlugin = 1]]) -- Command-line completion mode
---------------
-- Neovim UI --
---------------
@ -52,7 +56,7 @@ vim.cmd("syntax sync minlines=256")
set.mousescroll = "ver:1,hor:1"
set.shiftwidth = 2 -- Change the number of space characters inserted for indentation
set.showtabline = 1 -- Always show tabs
set.cmdheight = 1 -- More space for displaying messages
set.cmdheight = 0 -- More space for displaying messages
vim.cmd([[set nowrap]]) -- Display long lines as just one line
vim.cmd([[set noshowmode]]) -- We don't need to see things like -- INSERT -- anymore
vim.cmd([[syntax enable]]) -- Enables syntax highlighing

View File

@ -2,7 +2,7 @@ local fn = vim.fn
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
local packer_bootstrap = false
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap =
packer_bootstrap = true
fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
vim.cmd("packadd packer.nvim")
end
@ -16,48 +16,87 @@ packer.init({
},
})
print("eeey")
return packer.startup(function(use)
-- Let packer manage itself
use("wbthomason/packer.nvim")
use("lewis6991/impatient.nvim")
-- General Helper Functions
use("lewis6991/impatient.nvim")
use("nvim-lua/plenary.nvim")
-- Theming Section
---------------------
-- Theming Section --
---------------------
use("rktjmp/fwatch.nvim") -- Used to check dark/light theme
-- use("EdenEast/nightfox.nvim")
use({ "catppuccin/nvim", as = "catppuccin" })
use("nvim-lualine/lualine.nvim")
-- use("sam4llis/nvim-tundra")
-- Layout Plugins
--------------------
-- Layout Plugins --
--------------------
use("dstein64/nvim-scrollview") -- ScrollBars
use("akinsho/nvim-toggleterm.lua")
use("rcarriga/nvim-notify")
use("kyazdani42/nvim-web-devicons")
use("kyazdani42/nvim-tree.lua")
use("nvim-lua/popup.nvim")
use("goolord/alpha-nvim") -- startup screen
use("Pocco81/true-zen.nvim")
use({
"terrortylor/nvim-comment",
"rcarriga/nvim-notify",
config = function()
require("nvim_comment").setup()
require("configs.notify")
end,
event = "VimEnter",
})
use({
"kyazdani42/nvim-tree.lua",
requires = { "kyazdani42/nvim-web-devicons" },
cmd = "NvimTreeToggle",
config = function()
require("configs.tree")
end,
})
use("gfeiyou/command-center.nvim")
use("glepnir/lspsaga.nvim")
use("nvim-lua/popup.nvim")
use("goolord/alpha-nvim") -- startup screen
-- use("Pocco81/true-zen.nvim")
use({
"numToStr/Comment.nvim",
event = "BufReadPre",
config = function()
require("Comment").setup()
end,
})
-- use("gfeiyou/command-center.nvim")
use("glepnir/lspsaga.nvim") -- better windows for lsp replace, goto definition etc...
---------------------
-- Code Navigation --
---------------------
-- Code Navigation
use("junegunn/fzf")
use("nvim-telescope/telescope.nvim")
use({
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
config = function()
require("configs.telescope")
end,
})
use("ThePrimeagen/harpoon")
-- Lsp Errors
---------------
-- Lsp Setup --
---------------
use("neovim/nvim-lspconfig")
use("williamboman/mason.nvim")
use("williamboman/mason-lspconfig.nvim")
use("jose-elias-alvarez/null-ls.nvim")
use("folke/lsp-colors.nvim")
use("kosayoda/nvim-lightbulb")
use({
"folke/trouble.nvim",
event = "BufRead",
requires = "kyazdani42/nvim-web-devicons",
config = function()
require("trouble").setup({})
@ -66,64 +105,119 @@ return packer.startup(function(use)
use("onsails/lspkind.nvim")
use({
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
event = "BufReadPre",
config = function()
require("lsp_lines").setup()
end,
})
-- Syntax / Autocomplete
-------------------
-- Autocomplete --
-------------------
use("tpope/vim-surround")
use("neovim/nvim-lspconfig")
use("hrsh7th/nvim-cmp")
use({
"hrsh7th/nvim-cmp",
requires = {
"rafamadriz/friendly-snippets",
"saadparwaiz1/cmp_luasnip",
"L3MON4D3/LuaSnip",
"windwp/nvim-autopairs",
"zbirenbaum/copilot.lua",
"zbirenbaum/copilot-cmp",
},
event = { "BufReadPre", "CmdlineChanged" },
config = function()
require("nvim-autopairs").setup()
require("configs.autocomplete")
require("configs.snippets")
end,
})
use("hrsh7th/cmp-nvim-lsp")
use("hrsh7th/cmp-path")
-- use("hrsh7th/cmp-calc")
use("hrsh7th/cmp-buffer")
use("hrsh7th/cmp-cmdline")
use("rafamadriz/friendly-snippets")
use("L3MON4D3/LuaSnip")
use("saadparwaiz1/cmp_luasnip")
use({ "williamboman/mason.nvim" })
use({ "williamboman/mason-lspconfig.nvim" })
use({ "jose-elias-alvarez/null-ls.nvim" })
use("MunifTanjim/prettier.nvim")
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
use({
"hrsh7th/cmp-nvim-lsp",
after = "nvim-cmp",
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
require("lspconfig").html.setup({
capabilities = capabilities,
})
end,
})
use({ "hrsh7th/cmp-cmdline", after = "nvim-cmp" })
use({ "hrsh7th/cmp-path", after = "nvim-cmp" })
use({ "hrsh7th/cmp-nvim-lua", after = "nvim-cmp" })
use({ "hrsh7th/cmp-calc", after = "nvim-cmp" })
use({ "hrsh7th/cmp-emoji", after = "nvim-cmp" })
use({
"https://github.com/nat-418/boole.nvim",
event = "BufReadPre",
config = function()
require("boole").setup()
end,
})
use({
"gaoDean/autolist.nvim",
event = "BufReadPre",
config = function()
require("autolist").setup({})
end,
})
-------------------------
-- Syntax Highlighting --
-------------------------
use({
"nvim-treesitter/nvim-treesitter",
event = "BufReadPost",
requires = {
"nvim-treesitter/nvim-treesitter-textobjects",
},
config = function()
require("configs.treesitter")
end,
run = ":TSUpdate",
})
--------------------
-- IDE Type Stuff --
--------------------
-- Dap Debugger -- Have not yet been able to set this up
-- use({ "mfussenegger/nvim-dap" })
-- use({ "rcarriga/nvim-dap-ui" })
use { 'michaelb/sniprun', run = 'bash ./install.sh' }
-- FIle Navigation
use({ "ThePrimeagen/harpoon" })
-- More IDE like features
-- use({ "rcarriga/nvim-dap-ui" free
use("editorconfig/editorconfig-vim")
use({
"iamcco/markdown-preview.nvim",
run = function()
vim.fn["mkdp#util#install"]()
"michaelb/sniprun",
event = "BufReadPost",
config = function()
require("configs.sniprun")
end,
run = "bash ./install.sh",
})
use({
"uga-rosa/translate.nvim",
event = "InsertEnter",
config = function()
require("translate").setup({ default = { command = "deepl_free", output = "replace" } })
end,
})
use({
"nvim-neotest/neotest",
cmd = "NeoTest",
config = function()
require("configs.neotest")
end,
requires = {
"haydenmeade/neotest-jest",
"KaiSpencer/neotest-vitest",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
},
})
-- Database Feature
use("tpope/vim-dadbod")
use("kristijanhusak/vim-dadbod-ui")

View File

@ -15,7 +15,7 @@ cat.setup({
integrations = {
gitsigns = true,
telescope = true,
treesitter = true,
-- treesitter = true,
cmp = true,
lsp_saga = true,
notify = true,

View File

@ -0,0 +1,30 @@
local wezterm = require("wezterm")
local padding = 30
local function scheme_for_appearance(appearance)
if appearance:find("Dark") then
return "3024 Night"
else
return "Catppuccin Latte"
end
end
return {
font = wezterm.font("FiraCodeNerdFont"),
font_size = 13,
-- You can specify some parameters to influence the font selection;
-- for example, this selects a Bold, Italic font variant.
-- color_scheme = "Batman",
use_fancy_tab_bar = false,
hide_tab_bar_if_only_one_tab = true,
alternate_buffer_wheel_scroll_speed = 1,
color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()),
window_close_confirmation = "AlwaysPrompt",
window_padding = {
left = padding,
right = padding,
top = padding,
bottom = padding,
},
}

View File

@ -1,30 +1,146 @@
local wezterm = require("wezterm")
local wezterm = require 'wezterm'
local act = wezterm.action
local padding = 30
local default_prog
local default_cwd
local font_size
local tab_font_size
local initial_rows
local inital_cols
local function scheme_for_appearance(appearance)
if appearance:find("Dark") then
return "3024 Night"
if string.find(wezterm.target_triple, "windows") then
default_prog = { "wsl.exe" };
default_cwd = os.getenv("HOME");
tab_font_size = 9.0;
font_size = 10.7;
initial_rows = 43;
initial_cols = 180;
end
if string.find(wezterm.target_triple, "darwin") then
tab_font_size = 15.0;
font_size = 16;
initial_rows = 38;
initial_cols = 120;
end
local keys = {
-- Keyboard Navigation
--- delete words backwards
{ key = "Backspace", mods = "CTRL", action = { SendKey = { key = "U", mods = "CTRL" } } },
{ key = "Backspace", mods = "CMD", action = { SendKey = { key = "U", mods = "CTRL" } } },
{ key = "Backspace", mods = "ALT", action = { SendKey = { key = "W", mods = "CTRL" } } },
--- home and end
{ key = "LeftArrow", mods = "CTRL", action = { SendKey = { key = "Home" } } },
{ key = "LeftArrow", mods = "CMD", action = { SendKey = { key = "Home" } } },
{ key = "RightArrow", mods = "CTRL", action = { SendKey = { key = "End" } } },
{ key = "RightArrow", mods = "CMD", action = { SendKey = { key = "End" } } },
--- move one word
{ key = "LeftArrow", mods = "ALT", action = { SendKey = { key = "LeftArrow", mods = "CTRL" } } },
{ key = "RightArrow", mods = "ALT", action = { SendKey = { key = "RightArrow", mods = "CTRL" } } },
--- ctrl + jk keyboard navigation
{ key = "k", mods = "ALT", action = { SendKey = { key = "UpArrow" } } },
{ key = "k", mods = "CMD", action = { SendKey = { key = "UpArrow" } } },
{ key = "j", mods = "ALT", action = { SendKey = { key = "DownArrow" } } },
{ key = "j", mods = "CMD", action = { SendKey = { key = "DownArrow" } } },
--- accept completion on ctrl|alt|cmd + .
{ key = ".", mods = "CTRL", action = { SendKey = { key = "RightArrow" } } },
{ key = ".", mods = "ALT", action = { SendKey = { key = "RightArrow" } } },
{ key = ".", mods = "CMD", action = { SendKey = { key = "RightArrow" } } },
-- Fullscreen
{ key = "Enter", mods = "CTRL", action = "ToggleFullScreen" },
{ key = "Enter", mods = "CMD", action = "ToggleFullScreen" },
{ key = "Enter", mods = "ALT", action = "ToggleFullScreen" },
-- Clear Screen
{ key = "l", mods = "CMD", action = { SendKey = { key = "l", mods = "CTRL" } } },
{ key = "l", mods = "ALT", action = { SendKey = { key = "l", mods = "CTRL" } } },
{ key = "k", mods = "CMD", action = { SendKey = { key = "l", mods = "CTRL" } } },
-- Copy/Paste
{ key = "c", mods = "ALT", action = "Copy" },
{ key = "c", mods = "CMD", action = "Copy" },
{ key = "v", mods = "ALT", action = "Paste" },
{ key = "v", mods = "CMD", action = "Paste" },
-- Open New Window
{ key = "t", mods = "CMD", action = { SpawnTab = "CurrentPaneDomain" } },
{ key = "t", mods = "ALT", action = { SpawnTab = "CurrentPaneDomain" } },
{ key = "n", mods = "CMD", action = "SpawnWindow" },
{ key = "n", mods = "ALT", action = "SpawnWindow" },
{ key = "w", mods = "ALT", action = { EmitEvent = "CloseCurrentTab" } },
{ key = "w", mods = "CMD", action = { EmitEvent = "CloseCurrentTab" } },
-- Open the config
{ key = ",", mods = "ALT", action = { SendString = "vim ~/.config/wezterm/wezterm.lua\r\n" } },
{ key = ",", mods = "CMD", action = { SendString = "vim ~/.config/wezterm/wezterm.lua\r\n" } },
};
-- ALT-Tab
for i = 1, 9 do
table.insert(keys, { key = tostring(i), mods = "ALT", action = wezterm.action { ActivateTab = i - 1 } })
table.insert(keys, { key = tostring(i), mods = "CTRL", action = wezterm.action { ActivateTab = i - 1 } });
end
-- Delegate close confirmation to some apps such as VIM, etc.
wezterm.on("CloseCurrentTab", function(window, pane)
function is_vim()
local current_process = pane:get_title():upper()
return current_process:sub(- #"NVIM") == "NVIM" or current_process:sub(1, #"NVIM") == "NVIM" or
current_process:sub(- #"VIM") == "VIM" or current_process:sub(1, #"VIM") == "VIM" or
current_process:sub(- #"VI") == "VI" or current_process:sub(1, #"VI") == "VI"
end
if is_vim() then
window:perform_action(wezterm.action {
SendKey = { key = "Z", mods = "CTRL" }
}, pane)
else
return "Catppuccin Latte"
end
window:perform_action(wezterm.action {
CloseCurrentTab = { confirm = false }
}, pane)
end
end)
-- Colors
local colors = {
-- Tab Bar Ayu Mirage
}
local color_schemes = {
["Ayu"] = {
background = "#0f1419",
}
};
return {
font = wezterm.font("FiraCodeNerdFont"),
font_size = 13,
-- You can specify some parameters to influence the font selection;
-- for example, this selects a Bold, Italic font variant.
-- color_scheme = "Batman",
use_fancy_tab_bar = false,
hide_tab_bar_if_only_one_tab = true,
alternate_buffer_wheel_scroll_speed = 1,
color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()),
window_close_confirmation = "AlwaysPrompt",
window_padding = {
left = padding,
right = padding,
top = padding,
bottom = padding,
},
-- General
default_prog = default_prog,
default_cwd = default_cwd,
exit_behavior = "Close",
-- Key Bindings
keys = keys,
-- Window
initial_rows = initial_rows,
initial_cols = initial_cols,
window_padding = { left = 1, right = 1, top = 0, bottom = 0 },
-- Appearance and Colors
color_scheme = "Ayu",
colors = colors,
color_schemes = color_schemes,
window_decorations = "RESIZE",
default_cursor_style = "SteadyBlock",
audible_bell = "Disabled",
font_size = font_size,
harfbuzz_features = { "calt=0", "clig=0", "liga=0" },
window_frame = { font_size = tab_font_size, }
}

View File

@ -22,7 +22,7 @@ function fx(){
fi
if [ "$1" = "v" ]; then
nvim .
nvim
fi
if [ "$1" = "o" ]; then