From e7b64d13478662deb328e22af8e26d180bd90d31 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Tue, 22 Nov 2022 09:56:09 +0100 Subject: [PATCH] forward --- .config/nvim/lua/plugins/copilot.lua | 10 +- .config/nvim/lua/plugins/lsp-config.lua | 116 ++++++++++++------------ .config/nvim/lua/settings.lua | 2 +- .tmux.conf | 2 +- .zshrc | 5 +- bin/tmux-edit-helper | 12 +-- 6 files changed, 77 insertions(+), 70 deletions(-) diff --git a/.config/nvim/lua/plugins/copilot.lua b/.config/nvim/lua/plugins/copilot.lua index 766b423..7192bd0 100644 --- a/.config/nvim/lua/plugins/copilot.lua +++ b/.config/nvim/lua/plugins/copilot.lua @@ -1,4 +1,12 @@ -vim.keymap.set("i", "", [[copilot#Accept("")]], { noremap = true, silent = true, expr = true, script = true }) +local map = function(type, key, value, opts) + local options = { noremap = true } + if opts then + options = vim.tbl_extend("force", options, opts) + end + vim.api.nvim_set_keymap(type, key, value, options) +end + +map("i", "", [[copilot#Accept("")]], { noremap = true, silent = true, expr = true }) vim.g.copilot_no_tab_map = true vim.g.copilot_assume_mapped = true diff --git a/.config/nvim/lua/plugins/lsp-config.lua b/.config/nvim/lua/plugins/lsp-config.lua index f7e4eee..176acd9 100644 --- a/.config/nvim/lua/plugins/lsp-config.lua +++ b/.config/nvim/lua/plugins/lsp-config.lua @@ -182,71 +182,73 @@ lspconfig.yamlls.setup({ }, }) +require("lspconfig").tsserver.setup({}) + -- npm install -g typescript typescript-language-server -require("lspconfig").tsserver.setup({ - on_attach = function(client, bufnr) - client.resolved_capabilities.document_formatting = false - on_attach(client) +-- require("lspconfig").tsserver.setup({ +-- on_attach = function(client, bufnr) +-- client.resolved_capabilities.document_formatting = false +-- on_attach(client) - require("lsp_signature").on_attach({ - bind = false, -- This is mandatory, otherwise border config won't get registered. - -- If you want to hook lspsaga or other signature handler, pls set to false - doc_lines = 2, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated); - -- set to 0 if you DO NOT want any API comments be shown - -- This setting only take effect in insert mode, it does not affect signature help in normal - -- mode, 10 by default +-- require("lsp_signature").on_attach({ +-- bind = false, -- This is mandatory, otherwise border config won't get registered. +-- -- If you want to hook lspsaga or other signature handler, pls set to false +-- doc_lines = 2, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated); +-- -- set to 0 if you DO NOT want any API comments be shown +-- -- This setting only take effect in insert mode, it does not affect signature help in normal +-- -- mode, 10 by default - floating_window = true, -- show hint in a floating window, set to false for virtual text only mode - fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters - hint_enable = false, -- virtual hint enable - hint_prefix = "🐼 ", -- Panda for parameter - hint_scheme = "String", - use_lspsaga = true, -- set to true if you want to use lspsaga popup - hi_parameter = "Search", -- how your parameter will be highlight - max_height = 12, -- max height of signature floating_window, if content is more than max_height, you can scroll down - -- to view the hiding contents - max_width = 120, -- max_width of signature floating_window, line will be wrapped if exceed max_width - handler_opts = { - border = "single", -- double, single, shadow, none - }, - extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","} - }) +-- floating_window = true, -- show hint in a floating window, set to false for virtual text only mode +-- fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters +-- hint_enable = false, -- virtual hint enable +-- hint_prefix = "🐼 ", -- Panda for parameter +-- hint_scheme = "String", +-- use_lspsaga = true, -- set to true if you want to use lspsaga popup +-- hi_parameter = "Search", -- how your parameter will be highlight +-- max_height = 12, -- max height of signature floating_window, if content is more than max_height, you can scroll down +-- -- to view the hiding contents +-- max_width = 120, -- max_width of signature floating_window, line will be wrapped if exceed max_width +-- handler_opts = { +-- border = "single", -- double, single, shadow, none +-- }, +-- extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","} +-- }) - local ts_utils = require("nvim-lsp-ts-utils") +-- local ts_utils = require("nvim-lsp-ts-utils") - ts_utils.setup({ - debug = false, - disable_commands = false, - enable_import_on_completion = false, - import_all_timeout = 5000, -- ms +-- ts_utils.setup({ +-- debug = false, +-- disable_commands = false, +-- enable_import_on_completion = false, +-- import_all_timeout = 5000, -- ms - -- eslint - eslint_enable_code_actions = true, - eslint_enable_disable_comments = true, - eslint_bin = "eslint_d", - eslint_config_fallback = nil, - eslint_enable_diagnostics = true, +-- -- eslint +-- eslint_enable_code_actions = true, +-- eslint_enable_disable_comments = true, +-- eslint_bin = "eslint_d", +-- eslint_config_fallback = nil, +-- eslint_enable_diagnostics = true, - -- formatting - enable_formatting = true, - formatter = "prettier", - formatter_config_fallback = nil, +-- -- formatting +-- enable_formatting = true, +-- formatter = "prettier", +-- formatter_config_fallback = nil, - -- parentheses completion - complete_parens = false, - signature_help_in_parens = false, +-- -- parentheses completion +-- complete_parens = false, +-- signature_help_in_parens = false, - -- update imports on file move - update_imports_on_move = true, - require_confirmation_on_move = true, - watch_dir = nil, - }) +-- -- update imports on file move +-- update_imports_on_move = true, +-- require_confirmation_on_move = true, +-- watch_dir = nil, +-- }) - ts_utils.setup_client(client) +-- ts_utils.setup_client(client) - vim.api.nvim_buf_set_keymap(bufnr, "n", "co", ":TSLspOrganize", { silent = true }) - vim.api.nvim_buf_set_keymap(bufnr, "n", "qq", ":TSLspFixCurrent", { silent = true }) - vim.api.nvim_buf_set_keymap(bufnr, "n", "cR", ":TSLspRenameFile", { silent = true }) - vim.api.nvim_buf_set_keymap(bufnr, "n", "ci", ":TSLspImportAll", { silent = true }) - end, -}) +-- vim.api.nvim_buf_set_keymap(bufnr, "n", "co", ":TSLspOrganize", { silent = true }) +-- vim.api.nvim_buf_set_keymap(bufnr, "n", "qq", ":TSLspFixCurrent", { silent = true }) +-- vim.api.nvim_buf_set_keymap(bufnr, "n", "cR", ":TSLspRenameFile", { silent = true }) +-- vim.api.nvim_buf_set_keymap(bufnr, "n", "ci", ":TSLspImportAll", { silent = true }) +-- end, +-- }) diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 41dd8d4..e03d0aa 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -57,9 +57,9 @@ vim.wo.signcolumn = "yes" vim.o.laststatus = 3 vim.o.cmdheight = 1 -- vim.o.statusline = "═" -vim.o.fillchars = "stl: ,stlnc: " -- vim.o.title = true -- vim.o.titlestring = "%F%m %r %y" +vim.o.fillchars = "stl: ,stlnc: " vim.wo.foldmethod = "expr" vim.wo.foldexpr = "nvim_treesitter#foldexpr()" vim.g.netrw_dirhistmax = 0 diff --git a/.tmux.conf b/.tmux.conf index a87e1f8..6b8c709 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -16,7 +16,7 @@ set-option -g mouse on set -g set-clipboard on bind-key ] paste-buffer -p -set -g update-environment "XAUTHORITY DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION" +set -g update-environment "BUILDCOMMAND GOPACKAGESDRIVER XAUTHORITY DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION" set -g default-command zsh set -g history-limit 10000 diff --git a/.zshrc b/.zshrc index 6151653..5d07b4d 100644 --- a/.zshrc +++ b/.zshrc @@ -221,12 +221,9 @@ export ANSIBLE_NOCOWS=1 ## Docker export DOCKER_BUILDKIT=1 -## AWS -if [ -x /usr/bin/aws_zsh_completer.sh ]; then - source /usr/bin/aws_zsh_completer.sh -fi PROG=tea _CLI_ZSH_AUTOCOMPLETE_HACK=1 source "/home/dln/.config/tea/autocomplete.zsh" +## AWS autoload -U +X bashcompinit && bashcompinit complete -o nospace -C /usr/bin/mcli mcli complete -C '/usr/bin/aws_completer' aws diff --git a/bin/tmux-edit-helper b/bin/tmux-edit-helper index bfebcb9..e599dce 100755 --- a/bin/tmux-edit-helper +++ b/bin/tmux-edit-helper @@ -2,13 +2,13 @@ set -fe -o pipefail if [ -n "$1" ]; then - _file=$(readlink -f "$@") + _file=$(readlink -f "$@") else - FZF=${FZF:-"fzf-tmux -p 90%,50% -y 0"} - _git_root=$(git rev-parse --show-toplevel 2>/dev/null || pwd) - _store=$(echo "$_git_root" | sha1sum | cut -d ' ' -f 1) - _file=$( (fre --store_name "$_store" --sorted && fd --type f --hidden --follow --exclude .git . "$_git_root") | cat -n | sort -k2 -k1n | uniq -f1 | sort -nk1,1 | cut -f2- | $FZF --no-sort) - fre --store_name "$_store" --add "$_file" + FZF=${FZF:-"fzf-tmux -p 90%,50% -y 0"} + _git_root=$(git rev-parse --show-toplevel 2>/dev/null || pwd) + _store=$(echo "$_git_root" | sha1sum | cut -d ' ' -f 1) + _file=$( (fre --store_name "$_store" --sorted && fd --type f --hidden --follow --exclude .git . "$_git_root") | cat -n | sort -k2 -k1n | uniq -f1 | sort -nk1,1 | cut -f2- | $FZF --no-sort) + fre --store_name "$_store" --add "$_file" fi nvim --server "$XDG_RUNTIME_DIR/nvim.sock" --remote "$_file" && tmux select-window -t1