From a3ba35ab9e6628375f2829f0da792f3068e30a39 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sat, 26 Oct 2024 10:58:05 +0200 Subject: [PATCH] Updated scripts --- config/nvim/init.lua | 84 +++----------------------------------------- tmux.conf | 30 +++++++++------- update.sh | 11 ++++-- wezterm.lua | 6 ++-- 4 files changed, 35 insertions(+), 96 deletions(-) diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 857d411..78440b1 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -22,7 +22,6 @@ vim.o.undofile = true vim.o.ignorecase = true vim.o.smartcase = true - -- Keep signcolumn on by default vim.wo.signcolumn = 'yes' @@ -251,57 +250,6 @@ require('lazy').setup({ require("fzf-lua").setup({}) end }, - -- { - -- 'nvim-telescope/telescope.nvim', - -- dependencies = { 'nvim-lua/plenary.nvim' }, - -- opts = function() - -- local actions = require "telescope.actions" - -- return { - -- defaults = { - -- previewer = false, - -- path_display = { "truncate" }, - -- mappings = { - -- i = { - -- [""] = actions.cycle_history_next, - -- [""] = actions.cycle_history_prev, - -- [""] = actions.move_selection_next, - -- [""] = actions.move_selection_previous, - -- [""] = actions.select_default, - -- [""] = actions.close, - -- [""] = function(prompt_bufnr) - -- -- Use nvim-window-picker to choose the window by dynamically attaching a function - -- local action_set = require('telescope.actions.set') - -- local action_state = require('telescope.actions.state') - -- - -- local picker = action_state.get_current_picker(prompt_bufnr) - -- picker.get_selection_window = function(picker, entry) - -- local picked_window_id = require('window-picker').pick_window() or - -- vim.api.nvim_get_current_win() - -- -- Unbind after using so next instance of the picker acts normally - -- picker.get_selection_window = nil - -- return picked_window_id - -- end - -- - -- return action_set.edit(prompt_bufnr, 'edit') - -- end, - -- }, - -- n = { - -- ["q"] = actions.close, - -- [""] = actions.close, - -- }, - -- }, - -- }, - -- } - -- end, - -- }, - - -- { - -- "nvim-telescope/telescope-file-browser.nvim", - -- dependencies = { - -- "nvim-telescope/telescope.nvim", - -- "nvim-lua/plenary.nvim", - -- }, - -- }, { "nvim-neo-tree/neo-tree.nvim", @@ -476,10 +424,6 @@ require('lazy').setup({ -- GUI ------------------------------------------------------ - -- { - -- 'https://github.com/fresh2dev/zellij.vim.git', - -- lazy = false, - -- }, { 'mrjones2014/smart-splits.nvim', @@ -502,7 +446,7 @@ require('lazy').setup({ sections = { lualine_a = { 'mode' }, lualine_b = { 'branch', 'diff' }, - lualine_c = { 'filename' }, + lualine_c = { 'diagnostics', 'filename' }, lualine_x = { { -- Lsp server name . @@ -835,7 +779,6 @@ require 'lspconfig'.lua_ls.setup { } -- Setup neovim lua configuration --- require("telescope").load_extension "file_browser" -- [[ Configure nvim-cmp ]] local cmp = require 'cmp' @@ -942,10 +885,8 @@ cmp.setup.cmdline(':', { -- [[ Configure Treesitter ]] require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'markdown', 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, - - -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, + ensure_installed = { 'markdown_inline', 'markdown', 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, + auto_install = true, highlight = { enable = true }, indent = { enable = true }, @@ -1019,29 +960,14 @@ vim.keymap.set('n', 'h', require('smart-splits').swap_buf_left, vim.keymap.set('n', 'j', require('smart-splits').swap_buf_down, { desc = 'Swap buffer down' }) vim.keymap.set('n', 'k', require('smart-splits').swap_buf_up, { desc = 'Swap buffer up' }) vim.keymap.set('n', 'l', require('smart-splits').swap_buf_right, { desc = 'Swap buffer right' }) --- telescope --- vim.keymap.set('n', 'fo', require('telescope.builtin').oldfiles, { desc = 'Find recently opened files' }) --- vim.keymap.set('n', 'ff', --- ":lua require('telescope.builtin').find_files()", --- { desc = 'Find files', silent = true }) --- vim.keymap.set('n', 'fh', --- ":lua require('telescope.builtin').find_files({ hidden = true})", --- { desc = 'Find files', silent = true }) --- vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = 'Search help' }) --- vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = 'Search current word' }) --- vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = 'Search by grep' }) --- vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = 'Search diagnostics' }) --Other +vim.keymap.set('n', 's', ":HopWord", { desc = 'hop', silent = true }) vim.keymap.set('n', '', ":tabNext", { desc = 'Next tab', silent = true }) vim.keymap.set('n', '', ":Format", { desc = 'Format code', silent = true }) --- vim.keymap.set('n', 'gg', ":LazyGitCurrentFile", { desc = 'Format code', silent = true }) vim.keymap.set('n', '', ":make", { desc = 'Format code', silent = true }) vim.keymap.set('n', '', ":make clean", { desc = 'Format code', silent = true }) vim.keymap.set('n', '', ":write", { desc = 'Save', silent = true }) vim.keymap.set('n', '', ":quit", { desc = 'Quit', silent = true }) -vim.keymap.set('n', 'n', ":tabnew", { desc = 'Format code', silent = true }) -vim.keymap.set('n', 'c', ":tabclose", { desc = 'Format code', silent = true }) vim.keymap.set('n', 'e', ":Neotree filesystem reveal float toggle", { desc = 'File explorer', silent = true }) -vim.keymap.set('n', 's', ":HopWord", { desc = 'hop', silent = true }) -vim.keymap.set('n', 't', ":Trouble diagnostics toggle", { desc = 'Diagnostic view', silent = true }) +vim.keymap.set('n', 'd', ":Trouble diagnostics toggle", { desc = 'Diagnostic view', silent = true }) vim.keymap.set('n', 'f', ":FzfLua files", { desc = 'Find file', silent = true }) diff --git a/tmux.conf b/tmux.conf index cec5fa6..327907a 100644 --- a/tmux.conf +++ b/tmux.conf @@ -25,20 +25,26 @@ bind -n C-h run "($is_vim && tmux send-keys C-h) || tmux select-pane -L" bind -n C-j run "($is_vim && tmux send-keys C-j) || ($is_fzf && tmux send-keys C-j) || tmux select-pane -D" bind -n C-k run "($is_vim && tmux send-keys C-k) || ($is_fzf && tmux send-keys C-k) || tmux select-pane -U" bind -n C-l run "($is_vim && tmux send-keys C-l) || tmux select-pane -R" -bind -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l" +# bind -n 'C-\' if-shell "$is_vim" "send-keys C-\\" "select-pane -l" bind -n M-h run "($is_vim && tmux send-keys M-h) || tmux resize-pane -L 1" bind -n M-j run "($is_vim && tmux send-keys M-j) || tmux resize-pane -D 1" bind -n M-k run "($is_vim && tmux send-keys M-k) || tmux resize-pane -U 1" bind -n M-l run "($is_vim && tmux send-keys M-l) || tmux resize-pane -R 1" -# Split pane bindings -bind '"' split-window -v -c "#{pane_current_path}" -bind % split-window -h -c "#{pane_current_path}" - +bind -n M-1 select-window -t 1 +bind -n M-2 select-window -t 2 +bind -n M-3 select-window -t 3 +bind -n M-4 select-window -t 4 +bind -n M-5 select-window -t 5 +bind -n C-M-n select-window -n +bind -n C-M-c new-window +bind -n C-M-x confirm kill-pane +bind -n C-M-h split-window -v -c "#{pane_current_path}" +bind -n C-M-v split-window -h -c "#{pane_current_path}" bind -n C-g display-popup -d "#{pane_current_path}" -E -w 90% -h 90% "lazygit" -set-option -g status-position bottom +set-option -g status-position top set-option -g default-terminal "tmux-256color" set-option -sa terminal-features ',xterm-256color:RGB' set-option -sg escape-time 1 @@ -47,18 +53,16 @@ set-option -g focus-events on # set -g allow-passthrough on # set -g extended-keys on set -g status-interval 2 -set -g status-bg "#0c0c0c" -set -g status-fg "#6c6c6c" +set -g status-bg "#303030" +set -g status-fg "#c6c6c6" set -g status-left '' -set -g status-right '| %H:%M | %d-%b-%Y ' -# set -g status-right '#($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load -g 0 --interval 2) | %H:%M | %d-%b-%Y' -set -g status-right-length 100 +set -g status-right '#[fg=#87afd7,bg=#303030]#[fg=#c6c6c6,bg=#303030] #{pane_current_path} #[bg=#87afd7,fg=#000000] %d-%b-%Y %H:%M ' # Use normal and bright monochrome colors to show a tab line on the left. set -g status-justify left set-window-option -g window-status-separator '' -set-window-option -g window-status-format '#[bg=#0c0c0c,fg=#6c6c6c] #I #W ' -set-window-option -g window-status-current-format '#[bg=#0c0c0c,fg=#b0b0b0] #I #W ' +set-window-option -g window-status-format '#[bg=#303030,fg=#c6c6c6] #I ' +set-window-option -g window-status-current-format '#[bg=#87afd7,fg=#000000] #I ' # Switching panes should change the foreground color but not border colors. set -g window-style 'bg=default,fg=#c6c6c6' diff --git a/update.sh b/update.sh index e15d633..770b41e 100755 --- a/update.sh +++ b/update.sh @@ -227,8 +227,11 @@ if [ $DESKTOP == "yes" ]; then sudo apt install -y flatpak flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - printf -- '\033[33m Installing Visual Code\n\033[37m' - sudo snap install --classic code + printf -- '\033[33m Installing Flatseal\n\033[37m' + flatpak install -y flathub com.github.tchx84.Flatseal + + printf -- '\033[33m Installing Krita\n\033[37m' + flatpak install -y flathub org.kde.krita printf -- '\033[33m Installing KiCad\n\033[37m' flatpak install -y flathub org.kicad.KiCad @@ -242,6 +245,10 @@ if [ $DESKTOP == "yes" ]; then printf -- '\033[33m Installing DrawIo\n\033[37m' flatpak install -y flathub com.jgraph.drawio.desktop + # Install VSCode + printf -- '\033[33m Installing VSCode\n\033[37m' + sudo snap install --classic code + # Install gnome-shell-extension-manager printf -- '\033[33m Installing gnome-shell-extension-manager\n\033[37m' sudo apt install -y gnome-shell-extension-manager diff --git a/wezterm.lua b/wezterm.lua index 5b777dd..42a5ffa 100644 --- a/wezterm.lua +++ b/wezterm.lua @@ -9,6 +9,8 @@ end) local config = {} +-- config.window_decorations = "RESIZE" +config.enable_wayland = false config.keys = { { key = 'n', @@ -53,8 +55,8 @@ config.colors = { '#afd787', '#d7af5f', '#87afd7', - '#87afd7', '#d7d7af', + '#a0a0a0', '#eeeeee', }, brights = { @@ -63,8 +65,8 @@ config.colors = { '#afd787', '#d7af5f', '#87afd7', - '#87afd7', '#d7d7af', + '#a0a0a0', '#eeeeee', },