diff --git a/.tmux.conf b/.tmux.conf index c9774ed..d36d380 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -41,6 +41,7 @@ bind l select-pane -R # rename session/window bind n command-prompt 'rename-window %%' bind N command-prompt 'rename-session %%' +bind S command-prompt -p "New Session:" "new-session -A -s '%%'" # switch window bind-key , previous-window # < diff --git a/nvim.bak/lua/config/prelude.lua b/nvim.bak/lua/config/prelude.lua index b1c71e1..b062a3e 100644 --- a/nvim.bak/lua/config/prelude.lua +++ b/nvim.bak/lua/config/prelude.lua @@ -1,52 +1,3 @@ if vim.fn.has('nvim') == 0 then return end - -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 -vim.o.termguicolors = true - -vim.g.mapleader = ' ' -- Make sure to set `mapleader` before lazy so your mappings are correct -vim.g.maplocalleader = '\\' -- Same for `maplocalleader` - -vim.o.encoding = 'utf-8' -vim.o.fileencoding = 'utf-8' -vim.o.fencs = 'utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936' -vim.o.hidden = true -vim.o.wildmenu = true -vim.o.hlsearch = true -vim.o.incsearch = true -vim.o.matchtime = 1 -vim.o.showmatch = true -vim.o.updatetime = 100 -vim.o.ignorecase = true -vim.o.smarttab = true -vim.o.expandtab = true -vim.o.laststatus = 2 -vim.o.showcmd = true -vim.o.ruler = true -vim.o.history = 300 -vim.o.backup = false -vim.o.swapfile = false -vim.o.foldenable = false -vim.o.autoread = true -vim.o.autowrite = true -vim.o.mouse = 'a' - -vim.o.number = true -vim.o.cursorline = true -vim.o.relativenumber = true -vim.o.cursorcolumn = true -vim.o.signcolumn = 'auto:1' --- vim.o.cmdheight = 0 -vim.opt.list = true -vim.opt.listchars:append('eol:↴') -vim.opt.fillchars:append { diff = '╱' } - -vim.o.textwidth = 120 -vim.o.smartindent = true -vim.o.autoindent = true -vim.o.cindent = true -vim.o.shiftwidth = 4 -vim.o.softtabstop = 4 -vim.o.tabstop = 4 diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 0eba382..2c73136 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -30,5 +30,6 @@ "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, "ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" }, + "vim-wakatime": { "branch": "master", "commit": "e46d7c4f98ee0f40782008dd60cb2a79c377fb1d" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua index 4221e75..ab19c6a 100644 --- a/nvim/lua/config/autocmds.lua +++ b/nvim/lua/config/autocmds.lua @@ -6,3 +6,159 @@ -- -- Or remove existing autocmds by their group name (which is prefixed with `lazyvim_` for the defaults) -- e.g. vim.api.nvim_del_augroup_by_name("lazyvim_wrap_spell") + +vim.cmd('filetype plugin indent on') + +-- Create a group for our autocommands +local augroup = vim.api.nvim_create_augroup("CustomSettings", { clear = true }) + +-- FileType autocommands +vim.api.nvim_create_autocmd("FileType", { + pattern = "python", + group = augroup, + callback = function() + vim.opt_local.tabstop = 4 + vim.opt_local.shiftwidth = 4 + vim.opt_local.softtabstop = 4 + vim.opt_local.textwidth = 120 + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "go", + group = augroup, + callback = function() + vim.opt_local.tabstop = 4 + vim.opt_local.shiftwidth = 4 + vim.opt_local.softtabstop = 4 + vim.opt_local.textwidth = 120 + vim.opt_local.expandtab = false + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = { "json", "jsonnet" }, + group = augroup, + callback = function() + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.expandtab = true + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "yaml", + group = augroup, + callback = function() + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.textwidth = 0 + vim.opt_local.expandtab = true + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "gotmpl", + group = augroup, + callback = function() + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.textwidth = 0 + vim.opt_local.expandtab = true + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "php", + group = augroup, + callback = function() + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.textwidth = 120 + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = { "html", "htmldjango", "xhtml", "haml" }, + group = augroup, + callback = function() + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.textwidth = 0 + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "ruby", + group = augroup, + callback = function() + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.textwidth = 120 + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = { "less", "sass", "scss", "css" }, + group = augroup, + callback = function() + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.textwidth = 120 + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = { "javascript", "javascript.jsx", "javascriptreact", "typescript", "typescriptreact" }, + group = augroup, + callback = function() + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.expandtab = true + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "NvimTree", + group = augroup, + callback = function() + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + vim.opt_local.softtabstop = 2 + vim.opt_local.textwidth = 0 + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "make", + group = augroup, + callback = function() + vim.opt_local.expandtab = false + vim.opt_local.shiftwidth = 8 + vim.opt_local.softtabstop = 0 + end, +}) + +-- File pattern autocommands +vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { + pattern = "*.proto", + group = augroup, + command = "setfiletype proto", +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "proto", + group = augroup, + callback = function() + vim.opt_local.shiftwidth = 2 + vim.opt_local.expandtab = true + end, +}) \ No newline at end of file diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 3ea1454..d28623a 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -1,3 +1,55 @@ -- Options are automatically loaded before lazy.nvim startup -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua -- Add any additional options here +local opt = vim.opt +local o = vim.o +local g = vim.g + +g.loaded_netrw = 1 +g.loaded_netrwPlugin = 1 +o.termguicolors = true + +g.mapleader = ' ' -- Make sure to set `mapleader` before lazy so your mappings are correct +g.maplocalleader = '\\' -- Same for `maplocalleader` + +o.encoding = 'utf-8' +o.fileencoding = 'utf-8' +o.fencs = 'utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936' +o.hidden = true +o.wildmenu = true +o.hlsearch = true +o.incsearch = true +o.matchtime = 1 +o.showmatch = true +o.updatetime = 100 +o.ignorecase = true +o.smarttab = true +o.expandtab = true +o.laststatus = 2 +o.showcmd = true +o.ruler = true +o.history = 300 +o.backup = false +o.swapfile = false +o.foldenable = false +o.autoread = true +o.autowrite = true +o.mouse = 'a' + +o.number = true +o.cursorline = true +o.relativenumber = true +o.cursorcolumn = true +o.signcolumn = 'auto:1' +-- o.cmdheight = 0 +opt.list = true +opt.listchars:append('eol:↴') +opt.fillchars:append { diff = '╱' } + +o.textwidth = 120 +o.smartindent = true +o.autoindent = true +o.cindent = true +o.shiftwidth = 4 +o.softtabstop = 4 +o.tabstop = 4 \ No newline at end of file diff --git a/nvim/lua/plugins/disabled.lua b/nvim/lua/plugins/disabled.lua new file mode 100644 index 0000000..7f52995 --- /dev/null +++ b/nvim/lua/plugins/disabled.lua @@ -0,0 +1,3 @@ +return { + -- disable the plugins +} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..f7b001a --- /dev/null +++ b/nvim/lua/plugins/lsp.lua @@ -0,0 +1,18 @@ +return { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "bash-language-server", + "shfmt", + "shellcheck", + "emmet-ls", + "eslint_d", + "pyright", + "html-lsp", + "prettier", + "autopep8", + "stylua", + "gopls", + }, + }, +} diff --git a/nvim/lua/plugins/wakatime.lua b/nvim/lua/plugins/wakatime.lua new file mode 100644 index 0000000..fd064e4 --- /dev/null +++ b/nvim/lua/plugins/wakatime.lua @@ -0,0 +1,4 @@ +return { + "wakatime/vim-wakatime", + event = "InsertEnter", +} diff --git a/wezterm/wezterm.lua b/wezterm/wezterm.lua index 5f7a9da..756b148 100644 --- a/wezterm/wezterm.lua +++ b/wezterm/wezterm.lua @@ -1,10 +1,10 @@ local wezterm = require("wezterm") return { - default_cwd = wezterm.home_dir .. "/work", + default_cwd = wezterm.home_dir .. "/Workbench", font_size = 14, font = wezterm.font_with_fallback({ - "Maple Mono NF CN", "JetBrainsMono Nerd Font", + "Maple Mono NF CN", }), colors = { tab_bar = {