diff --git a/.config/nvim/lua/config/general/autocmd.lua b/.config/nvim/lua/config/general/autocmd.lua index 56b13b1..368587c 100644 --- a/.config/nvim/lua/config/general/autocmd.lua +++ b/.config/nvim/lua/config/general/autocmd.lua @@ -16,8 +16,8 @@ local aucmd_dict = { }, { pattern = "*.go", - command = 'GoFormat' - } + command = 'silent! lua require(\'go.format\').goimport()' + }, }, BufRead = { { diff --git a/.config/nvim/lua/config/go.lua b/.config/nvim/lua/config/go.lua index e26b510..bd41a3b 100644 --- a/.config/nvim/lua/config/go.lua +++ b/.config/nvim/lua/config/go.lua @@ -1 +1,88 @@ -require('go').setup() +require('go').setup({ + + disable_defaults = false, -- true|false when true set false to all boolean settings and replace all table + -- settings with {} + go='go', -- go command, can be go[default] or go1.18beta1 + goimport='gopls', -- goimport command, can be gopls[default] or goimport + fillstruct = 'gopls', -- can be nil (use fillstruct, slower) and gopls + gofmt = 'gofumpt', --gofmt cmd, + max_line_len = 128, -- max line length in golines format, Target maximum line length for golines + tag_transform = false, -- can be transform option("snakecase", "camelcase", etc) check gomodifytags for details and more options + gotests_template = "", -- sets gotests -template parameter (check gotests for details) + gotests_template_dir = "", -- sets gotests -template_dir parameter (check gotests for details) + comment_placeholder = '' , -- comment_placeholder your cool placeholder e.g. ﳑ     + icons = {breakpoint = '🧘', currentpos = '🏃'}, -- setup to `false` to disable icons setup + verbose = false, -- output loginf in messages + lsp_cfg = false, -- true: use non-default gopls setup specified in go/lsp.lua + -- false: do nothing + -- if lsp_cfg is a table, merge table with with non-default gopls setup in go/lsp.lua, e.g. + -- lsp_cfg = {settings={gopls={matcher='CaseInsensitive', ['local'] = 'your_local_module_path', gofumpt = true }}} + lsp_gofumpt = false, -- true: set default gofmt in gopls format to gofumpt + lsp_on_attach = nil, -- nil: use on_attach function defined in go/lsp.lua, + -- when lsp_cfg is true + -- if lsp_on_attach is a function: use this function as on_attach function for gopls + lsp_keymaps = true, -- set to false to disable gopls/lsp keymap + lsp_codelens = true, -- set to false to disable codelens, true by default, you can use a function + -- function(bufnr) + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "F", "lua vim.lsp.buf.formatting()", {noremap=true, silent=true}) + -- end + -- to setup a table of codelens + lsp_diag_hdlr = true, -- hook lsp diag handler + -- virtual text setup + lsp_diag_virtual_text = { space = 0, prefix = "" }, + lsp_diag_signs = true, + lsp_diag_update_in_insert = false, + lsp_document_formatting = true, + -- set to true: use gopls to format + -- false if you want to use other formatter tool(e.g. efm, nulls) + lsp_inlay_hints = { + enable = true, + -- Only show inlay hints for the current line + only_current_line = false, + -- Event which triggers a refersh of the inlay hints. + -- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but + -- not that this may cause higher CPU usage. + -- This option is only respected when only_current_line and + -- autoSetHints both are true. + only_current_line_autocmd = "CursorHold", + -- whether to show variable name before type hints with the inlay hints or not + -- default: false + show_variable_name = true, + -- prefix for parameter hints + parameter_hints_prefix = " ", + show_parameter_hints = true, + -- prefix for all the other hints (type, chaining) + other_hints_prefix = "=> ", + -- whether to align to the lenght of the longest line in the file + max_len_align = false, + -- padding from the left if max_len_align is true + max_len_align_padding = 1, + -- whether to align to the extreme right or not + right_align = false, + -- padding from the right if right_align is true + right_align_padding = 6, + -- The color of the hints + highlight = "Comment", + }, + gopls_cmd = nil, -- if you need to specify gopls path and cmd, e.g {"/home/user/lsp/gopls", "-logfile","/var/log/gopls.log" } + gopls_remote_auto = true, -- add -remote=auto to gopls + gocoverage_sign = "█", + sign_priority = 5, -- change to a higher number to override other signs + dap_debug = true, -- set to false to disable dap + dap_debug_keymap = true, -- true: use keymap for debugger defined in go/dap.lua + -- false: do not use keymap in go/dap.lua. you must define your own. + -- windows: use visual studio keymap + dap_debug_gui = true, -- set to true to enable dap gui, highly recommand + dap_debug_vt = true, -- set to true to enable dap virtual text + -- build_tags = "tag1,tag2", -- set default build tags + textobjects = true, -- enable default text jobects through treesittter-text-objects + test_runner = 'go', -- one of {`go`, `richgo`, `dlv`, `ginkgo`} + verbose_tests = true, -- set to add verbose flag to tests + run_in_floaterm = false, -- set to true to run in float window. :GoTermClose closes the floatterm + -- float term recommand if you use richgo/ginkgo with terminal color + + trouble = false, -- true: use trouble to open quickfix + test_efm = false, -- errorfomat for quickfix, default mix mode, set to true will be efm only + luasnip = false, -- enable included luasnip snippets. you can also disable while add lua/snips folder to luasnip load + -- Do not enable this if you already added the path, that will duplicate the entries +}) diff --git a/.config/nvim/lua/packer-plugins.lua b/.config/nvim/lua/packer-plugins.lua index 4e9e5da..2b8eea7 100644 --- a/.config/nvim/lua/packer-plugins.lua +++ b/.config/nvim/lua/packer-plugins.lua @@ -106,11 +106,11 @@ return require('packer').startup(function() end } - + use 'ray-x/guihua.lua' use { - 'crispgm/nvim-go', - config = function () - require('config.nvim-go') + 'ray-x/go.nvim', + config = function() + require('config.go') end } @@ -134,14 +134,6 @@ return require('packer').startup(function() end } - -- use { - -- "startup-nvim/startup.nvim", - -- requires = {"nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim"}, - -- config = function() - -- require"startup".setup() - -- end - -- } - -- Local nvim plugin development -- use '~/Software/nvim-phpdoc/phpdoc.nvim' end) diff --git a/.local/bin/dwm-sss b/.local/bin/dwm-sss index 75e64d8..e1aba39 100755 --- a/.local/bin/dwm-sss +++ b/.local/bin/dwm-sss @@ -6,6 +6,8 @@ do t=$(echo $f | cut -b -2).$(echo $f | cut -b 3-)°C d=$(date '+%a %b %d, %H:%M') p=$(pacman -Qu | grep -v "\[ignored\]" | wc -l) - xsetroot -name " Pkgs: ${p} | ${d} | ${t}" + pi=$(pacman -Q | wc -l) + s=$(df -h / | tail -n 1 | awk '{ print $4 }') + xsetroot -name " /: ${s} | Pkgs: ${p}/${pi} | ${t} | ${d} " sleep 60; done; diff --git a/.local/bin/nohup.out b/.local/bin/nohup.out new file mode 100644 index 0000000..e69de29 diff --git a/.zshrc b/.zshrc index 36337a1..7f06d1d 100644 --- a/.zshrc +++ b/.zshrc @@ -182,6 +182,11 @@ cdv () { cd $(xclip -selection clipboard -o) } +function chpwd() { + print -n "\e]2;st - $(whoami)@$(hostname) - $(pwd | sed 's/\/home\/tovi/~/g')\a" +} +print -n "\e]2;st - $(whoami)@$(hostname) - $(pwd | sed 's/\/home\/tovi/~/g')\a" + export PATH="/usr/local/opt/php@7.4/bin:$PATH" export PATH="/usr/local/opt/php@7.4/sbin:$PATH" @@ -208,3 +213,12 @@ export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin/ export PATH=$PATH:$ANDROID_ROOT/emulator export PATH=$PATH:$ANDROID_SDK_ROOT/tools/ export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin + +export PATH="/run/user/1000/fnm_multishells/20590_1663546026606/bin":$PATH +export FNM_MULTISHELL_PATH="/run/user/1000/fnm_multishells/20590_1663546026606" +export FNM_VERSION_FILE_STRATEGY="local" +export FNM_DIR="/home/tovi/.local/share/fnm" +export FNM_LOGLEVEL="info" +export FNM_NODE_DIST_MIRROR="https://nodejs.org/dist" +export FNM_ARCH="x64" +rehash