From 06d488ab21666cbafc20822fe4997c549341c61b Mon Sep 17 00:00:00 2001 From: minhtrannhat Date: Mon, 24 Jan 2022 10:37:58 -0500 Subject: [PATCH] Various fixes --- doom-emacs/.doom.d/config.el | 10 ++++---- doom-emacs/.doom.d/custom.el | 1 + fish/.config/fish/config.fish | 12 +++++++++- git/.gitconfig | 6 +++++ lvim/.config/lvim/config.lua | 45 +++++++++++++++++++++++++++-------- sway/.config/sway/config | 11 ++++----- tmux/.tmux.conf | 2 +- 7 files changed, 63 insertions(+), 24 deletions(-) diff --git a/doom-emacs/.doom.d/config.el b/doom-emacs/.doom.d/config.el index cedfca0..185d043 100644 --- a/doom-emacs/.doom.d/config.el +++ b/doom-emacs/.doom.d/config.el @@ -82,11 +82,6 @@ ;; org org (setq +latex-viewers '(zathura)) -;; (after! org (setq org-hide-emphasis-markers t)) -;; (add-hook! org-mode (electric-indent-local-mode -1)) -;; (add-hook! org-mode :append -;; #'visual-line-mode) - ;; fish fish (setq vterm-shell 'fish) @@ -162,6 +157,11 @@ (setq avy-all-windows 't) +;; Disables lsp-signature-auto-activate globally +(after! lsp-mode + (setq lsp-signature-auto-activate nil)) + + (lsp-treemacs-sync-mode 1) (setq highlight-indent-guides-method 'bitmap) diff --git a/doom-emacs/.doom.d/custom.el b/doom-emacs/.doom.d/custom.el index c110170..e98d1cf 100644 --- a/doom-emacs/.doom.d/custom.el +++ b/doom-emacs/.doom.d/custom.el @@ -4,6 +4,7 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. + '(TeX-command-BibTeX "Biber") '(custom-safe-themes '("7eea50883f10e5c6ad6f81e153c640b3a288cd8dc1d26e4696f7d40f754cc703" "5784d048e5a985627520beb8a101561b502a191b52fa401139f4dd20acb07607" "e3b2bad7b781a968692759ad12cb6552bc39d7057762eefaf168dbe604ce3a4b" "1704976a1797342a1b4ea7a75bdbb3be1569f4619134341bd5a4c1cfb16abad4" "d268b67e0935b9ebc427cad88ded41e875abfcc27abd409726a92e55459e0d01" default)) '(git-gutter:update-interval 1) diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 12070b9..88f13d8 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -10,6 +10,16 @@ alias qutebrowser 'qutebrowser --qt-flag ignore-gpu-blocklist --qt-flag enable-g export GPG_TTY=(tty) +gpgconf --launch gpg-agent + +# config.fish +if test -z (pgrep ssh-agent) + eval (ssh-agent -c) + set -Ux SSH_AUTH_SOCK $SSH_AUTH_SOCK + set -Ux SSH_AGENT_PID $SSH_AGENT_PID + set -Ux SSH_AUTH_SOCK $SSH_AUTH_SOCK +end + set -gx MOZ_WEBRENDER 1 set -gx XDG_SESSION_TYPE wayland set -gx XDG_CURRENT_DESKTOP sway @@ -24,7 +34,7 @@ set -Ux XMODIFIERS @im=ibus set -gx EDITOR lvim set -gx NVIM_LISTEN_ADDRESS /tmp/nvimsocket - +set -gx MANPAGER "lvim +Man!" set -gx LC_ALL en_US.UTF-8 set -gx _JAVA_AWT_WM_NONREPARENTING 1 diff --git a/git/.gitconfig b/git/.gitconfig index 1292903..e7991be 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -26,3 +26,9 @@ diffFilter = delta --color-only [github] user = minhtrannhat + +[merge] + conflictstyle = diff3 + +[diff] + colorMoved = default diff --git a/lvim/.config/lvim/config.lua b/lvim/.config/lvim/config.lua index ec8f6da..97f1e90 100644 --- a/lvim/.config/lvim/config.lua +++ b/lvim/.config/lvim/config.lua @@ -13,12 +13,11 @@ lvim.shell = "/bin/fish" -- keymappings [view all the defaults by pressing Lk] lvim.leader = "space" - lvim.builtin.dashboard.active = true lvim.builtin.terminal.active = true lvim.builtin.autopairs.active = true lvim.builtin.gitsigns.active = true -lvim.builtin.dap.active = false +lvim.builtin.dap.active = true vim.opt.relativenumber = true lvim.builtin.nvimtree.side = "left" @@ -67,16 +66,42 @@ lvim.plugins = { end, event = "InsertEnter", }, + { "machakann/vim-sandwich" }, { "tpope/vim-fugitive" }, - { "TimUntersberger/neogit", requires = "nvim-lua/plenary.nvim" }, } --- Neogit - A emacs magit clone -local neogit = require("neogit") +-- Changes to clangd +vim.list_extend(lvim.lsp.override, { "clangd" }) -neogit.setup({}) - -lvim.builtin.which_key.mappings["gg"] = { - "Neogit kind=split", - "Neogit", +-- some settings can only passed as commandline flags `clangd --help` +local clangd_flags = { + "--all-scopes-completion", + "--suggest-missing-includes", + "--background-index", + "--pch-storage=disk", + "--cross-file-rename", + "--log=info", + "--completion-style=detailed", + "--enable-config", -- clangd 11+ supports reading from .clangd configuration file + "--clang-tidy", + "--offset-encoding=utf-16", + "--clang-tidy-checks=-*,llvm-*,clang-analyzer-*,modernize-*,-modernize-use-trailing-return-type", + "--fallback-style=Google", + -- "--header-insertion=never", + -- "--query-driver=" } + +local clangd_bin = "clangd" + +local custom_on_attach = function(client, bufnr) + require("lvim.lsp").common_on_attach(client, bufnr) + local opts = { noremap = true, silent = true } + vim.api.nvim_buf_set_keymap(bufnr, "n", "lh", "ClangdSwitchSourceHeader", opts) +end + +local opts = { + cmd = { clangd_bin, unpack(clangd_flags) }, + on_attach = custom_on_attach, +} + +require("lvim.lsp.manager").setup("clangd", opts) diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 2e6550b..fd16579 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -14,9 +14,6 @@ exec mako # mounting external hard drives exec udiskie -# ssh-agent yayy no password -exec fish_ssh_agent - # night light and some gamma decrease exec wlsunset -l 45.6 -L -73.5 -g 0.8 @@ -26,9 +23,6 @@ exec autotiling # window manager exec env RUST_BACKTRACE=1 swayrd > /tmp/swayrd.log 2>&1 -# gpg-agent -exec eval (gpg-agent -c) - ### Variables # # Logo key. Use Mod1 for Alt. @@ -86,7 +80,10 @@ exec swayidle -w \ for_window [title="Firefox — Sharing Indicator"] floating enable for_window [title="Firefox — Sharing Indicator"] nofocus -# +for_window [app_id="mpv"] inhibit_idle visible; border none; max_render_time off +for_window [class="firefox"] inhibit_idle fullscreen; max_render_time off +for_window [app_id="firefox"] inhibit_idle fullscreen; max_render_time off + # This will lock your screen after 300 seconds of inactivity, then turn off # your displays after another 300 seconds, and turn your screens back on when # resumed. It will also lock your screen before your computer goes to sleep. diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index a881d03..2f3a513 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -21,7 +21,7 @@ bind-key -T copy-mode-vi v send-keys begin-selection bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'wl-copy' # reload config file (change file location to your the tmux.conf you want to use) -bind r source-file /etc/tmux.conf +bind r source-file /home/minhradz/.tmux.conf # switch panes using Alt-arrow without prefix bind -n M-Left select-pane -L