From 7fd66bce707b8317eea5c5e8ca647f87c90dd26d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Wed, 23 Nov 2022 16:28:56 +0100 Subject: [PATCH] sync --- dot_config/nvim/lua/configs/colors.lua | 2 +- dot_config/nvim/lua/configs/lsp.lua | 8 ++-- dot_config/nvim/lua/configs/neotree.lua | 2 +- dot_config/nvim/lua/configs/packages.lua | 1 + dot_config/nvim/lua/configs/treesitter.lua | 50 ++++++++++++++++++++++ dot_config/private_qutebrowser/quickmarks | 1 + dot_config/zsh/.keep | 0 dot_config/zsh/aliases.zsh | 30 ------------- dot_config/zsh/functions.zsh | 27 ------------ dot_config/zsh/include/aliases.zsh | 2 + dot_zimrc | 3 +- 11 files changed, 63 insertions(+), 63 deletions(-) delete mode 100644 dot_config/zsh/.keep delete mode 100644 dot_config/zsh/aliases.zsh delete mode 100644 dot_config/zsh/functions.zsh diff --git a/dot_config/nvim/lua/configs/colors.lua b/dot_config/nvim/lua/configs/colors.lua index 2011b12..9a1769c 100644 --- a/dot_config/nvim/lua/configs/colors.lua +++ b/dot_config/nvim/lua/configs/colors.lua @@ -171,7 +171,7 @@ local function normalizeTroubleHighlight() -- {{{ -- TroubleCount xxx links to TabLineSel -- copyFg('TroubleError', 'DiagnosticError') link('TroubleSignError', 'DiagnosticError') - link('TroubleSignWarning', 'DiagnosticSignWarn') + link('TroubleSignWarning', 'DiagnosticWarn') link('TroubleSignHint', 'DiagnosticHint') vim.api.nvim_set_hl(0, 'TroubleNormal', {}) diff --git a/dot_config/nvim/lua/configs/lsp.lua b/dot_config/nvim/lua/configs/lsp.lua index e05814b..4405ab0 100644 --- a/dot_config/nvim/lua/configs/lsp.lua +++ b/dot_config/nvim/lua/configs/lsp.lua @@ -28,9 +28,10 @@ local function on_attach(args) -- Mappings. local opts = { noremap = true, silent = true, buffer = args.buf } - if client.server_capabilities.definitionProvider then - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) - end + -- use LSP default tagfunc + -- if client.server_capabilities.definitionProvider then + -- vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + -- end if client.server_capabilities.declarationProvider then vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) @@ -139,6 +140,7 @@ function M.setup() return u.search_ancestors(startpath, function(path) return not string.find(path, '/vendor/') and ( u.path.exists(u.path.join(path, 'composer.json')) + or u.path.exists(u.path.join(path, 'sharedLibs')) or u.path.exists(u.path.join(path, '.git')) ) end) diff --git a/dot_config/nvim/lua/configs/neotree.lua b/dot_config/nvim/lua/configs/neotree.lua index 7d4fbba..1fe331b 100644 --- a/dot_config/nvim/lua/configs/neotree.lua +++ b/dot_config/nvim/lua/configs/neotree.lua @@ -158,7 +158,7 @@ function M.setup() -- "open_current", -- netrw disabled, opening a directory opens within the -- window like netrw would, regardless of window.position -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs - use_libuv_file_watcher = true, -- This will use the OS level file watchers to detect changes + use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes -- instead of relying on nvim autocmd events. window = { mappings = { diff --git a/dot_config/nvim/lua/configs/packages.lua b/dot_config/nvim/lua/configs/packages.lua index c88b9a2..b2921b1 100644 --- a/dot_config/nvim/lua/configs/packages.lua +++ b/dot_config/nvim/lua/configs/packages.lua @@ -79,6 +79,7 @@ function M.setup() } use 'nvim-treesitter/playground' use({ 'yioneko/nvim-yati', requires = 'nvim-treesitter/nvim-treesitter', tag = 'legacy' }) + use({ 'nvim-treesitter/nvim-treesitter-textobjects', requires = 'nvim-treesitter/nvim-treesitter'}) use { 'nvim-telescope/telescope.nvim', requires = { 'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim' }, diff --git a/dot_config/nvim/lua/configs/treesitter.lua b/dot_config/nvim/lua/configs/treesitter.lua index 7dec208..4be8f3d 100644 --- a/dot_config/nvim/lua/configs/treesitter.lua +++ b/dot_config/nvim/lua/configs/treesitter.lua @@ -3,6 +3,7 @@ local M = {} function M.setup() require 'nvim-treesitter.configs'.setup { ensure_installed = 'all', -- one of "all", "maintained" (parsers with maintainers), or a list of languages + sync_install = true, highlight = { enable = true, disable = { 'help' }, @@ -22,6 +23,55 @@ function M.setup() -- disable = { "php" },-- php indent SUCKS A LOT enable = false, }, + textobjects = { + swap = { + enable = true, + swap_next = { + [' pl'] = '@parameter.inner', + }, + swap_previous = { + [' ph'] = '@parameter.inner', + }, + }, + select = { + enable = true, + + -- Automatically jump forward to textobj, similar to targets.vim + lookahead = true, + + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + -- You can optionally set descriptions to the mappings (used in the desc parameter of + -- nvim_buf_set_keymap) which plugins like which-key display + ['ic'] = { query = '@class.inner', desc = 'Select inner part of a class region' }, + }, + -- You can choose the select mode (default is charwise 'v') + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * method: eg 'v' or 'o' + -- and should return the mode ('v', 'V', or '') or a table + -- mapping query_strings to modes. + selection_modes = { + ['@parameter.outer'] = 'v', -- charwise + ['@function.outer'] = 'V', -- linewise + ['@class.outer'] = '', -- blockwise + }, + -- If you set this to `true` (default is `false`) then any textobject is + -- extended to include preceding or succeeding whitespace. Succeeding + -- whitespace has priority in order to act similarly to eg the built-in + -- `ap`. + -- + -- Can also be a function which gets passed a table with the keys + -- * query_string: eg '@function.inner' + -- * selection_mode: eg 'v' + -- and should return true of false + include_surrounding_whitespace = true, + }, + } } local ts_parsers = require 'nvim-treesitter.parsers'.get_parser_configs() diff --git a/dot_config/private_qutebrowser/quickmarks b/dot_config/private_qutebrowser/quickmarks index f85da16..25aae82 100644 --- a/dot_config/private_qutebrowser/quickmarks +++ b/dot_config/private_qutebrowser/quickmarks @@ -3,3 +3,4 @@ git https://git.jopixel.cz/dashboard jira https://jira.jopixel.cz/secure/Dashboard.jspa support https://support.jopixel.cz/ admin https://admin.jopixel.com/ +gitlab https://repository.laya.io/ diff --git a/dot_config/zsh/.keep b/dot_config/zsh/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/dot_config/zsh/aliases.zsh b/dot_config/zsh/aliases.zsh deleted file mode 100644 index 467e587..0000000 --- a/dot_config/zsh/aliases.zsh +++ /dev/null @@ -1,30 +0,0 @@ -alias hosts="sudo vim /etc/hosts" - -alias vi=nvim -alias vim=nvim - -alias kid3=kid3-qt -alias torr=transmission-cli - -alias grevert="git checkout --" -alias gst='git status -s' -alias gp='git push' -alias gd='git diff' -alias gup='git pull --rebase' -alias gwch='git log -p --ext-diff' - -alias wine32='WINEARCH=win32 WINEPREFIX=/home/sogun/.wine32 wine' - -alias lg=lazygit - -alias catdb='git --no-pager show HEAD:www/app/config/database.cfg.d/connections.cfg.d/basic.cfg.php' - -alias scur='systemctl --user restart' -alias scus='systemctl --user stop' -alias scust='systemctl --user status' -alias slog='journalctl --user -u' - -alias ls='ls --color=tty --hyperlink=auto' - -alias rg='rg --no-ignore' -# vim: ft=zsh diff --git a/dot_config/zsh/functions.zsh b/dot_config/zsh/functions.zsh deleted file mode 100644 index 2a0e05d..0000000 --- a/dot_config/zsh/functions.zsh +++ /dev/null @@ -1,27 +0,0 @@ -pomerge() { - name="$1" - lang="${2:-cs_CZ.UTF-8}" - git_root="$(git worktree list --porcelain | awk 'NR == 1 {print $2; exit}')" - app_po="${git_root}/www/app/translate/gettext/$lang/LC_MESSAGES/$name.po" - new_po="${git_root}/www/userdata/locale/${name}_new.po" - [[ -d "$(dirname "$app_po")" ]] || mkdir -p "$(dirname "$app_po")" - [[ -e "$new_po" ]] || { echo "$new_po does not exist" ; return 1 ;} - if ! [[ -e "$app_po" ]] - then - cp -v "$new_po" "$app_po" - return - fi - tmp="$(mktemp)" - msgcat --use-first --no-location --no-wrap "$app_po" "$new_po" > "$tmp" - mv "$tmp" "$app_po" -} - -pocompile() { - name="$1" - lang="${2:-cs_CZ.UTF-8}" - git_root="$(git worktree list --porcelain | awk 'NR == 1 {print $2; exit}')" - app_po="${git_root}/www/app/translate/gettext/$lang/LC_MESSAGES/$name.po" - [[ -e "$app_po" ]] || { echo "$app_po does not exists"; return 1; } - - msgfmt -o "${app_po%po}mo" "$app_po" -} diff --git a/dot_config/zsh/include/aliases.zsh b/dot_config/zsh/include/aliases.zsh index 9a63ef9..facced8 100644 --- a/dot_config/zsh/include/aliases.zsh +++ b/dot_config/zsh/include/aliases.zsh @@ -26,4 +26,6 @@ alias slog='journalctl --user -u' alias ls='ls --color=tty --hyperlink=auto' alias l='ls -lh' +alias _=sudo + alias rg='rg --no-ignore' diff --git a/dot_zimrc b/dot_zimrc index 1bb4c3d..6d56cd8 100644 --- a/dot_zimrc +++ b/dot_zimrc @@ -1,4 +1,5 @@ -zmodule zsh-users/zsh-syntax-highlighting +#zmodule zsh-users/zsh-syntax-highlighting +zmodule zdharma-continuum/fast-syntax-highlighting zmodule input zmodule romkatv/powerlevel10k --use degit zmodule agkozak/zsh-z