This commit is contained in:
Christian Nieves
2022-07-14 18:33:13 +00:00
parent b39610bd69
commit 14c4347c9c
8 changed files with 33 additions and 22 deletions

View File

@ -30,6 +30,7 @@ cmp.setup({
["<C-e>"] = cmp.mapping.close(), ["<C-e>"] = cmp.mapping.close(),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), ["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
["<C-m>"] = cmp.mapping.confirm({ select = true }), ["<C-m>"] = cmp.mapping.confirm({ select = true }),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()

View File

@ -74,20 +74,10 @@ vim.api.nvim_set_keymap('v', '<leader>sd',
{ noremap = true, silent=true } { noremap = true, silent=true }
) )
vim.api.nvim_set_keymap(
"n",
"<leader>cs",
[[<cmd>lua require('telescope').extensions.codesearch.find_files{}<CR>]],
{ noremap = true, silent = true }
)
-- Search using codesearch queries. -- Search using codesearch queries.
vim.api.nvim_set_keymap( vim.api.nvim_set_keymap(
"n", "n",
"<leader>csd", "<leader>cs",
[[<cmd>lua require('telescope').extensions.codesearch.find_query{}<CR>]], [[<cmd>lua require('telescope').extensions.codesearch.find_query{}<CR>]],
{ noremap = true, silent = true } { noremap = true, silent = true }
) )
@ -111,7 +101,7 @@ vim.api.nvim_set_keymap(
-- Search for text selected in Visual mode. -- Search for text selected in Visual mode.
vim.api.nvim_set_keymap( vim.api.nvim_set_keymap(
"v", "v",
"<leader>csd", "<leader>cs",
[[<cmd>lua require('telescope').extensions.codesearch.find_query{}<CR>]], [[<cmd>lua require('telescope').extensions.codesearch.find_query{}<CR>]],
{ noremap = true, silent = true } { noremap = true, silent = true }
) )

View File

@ -233,7 +233,7 @@ awk -v match_prefix=${match_prefix} ' { for (i = 1; i <= NF; i++) {
} }
# CTRL-Q - Paste the selected flags into the command line. Copied from CTRL-T # CTRL-F - Paste the selected flags into the command line. Copied from CTRL-T
# bindings shown here: # bindings shown here:
# https://github.com/junegunn/fzf/blob/master/shell/key-bindings.zsh # https://github.com/junegunn/fzf/blob/master/shell/key-bindings.zsh
__flagsel() { __flagsel() {
@ -270,4 +270,4 @@ fzf-flag-widget() {
return $ret return $ret
} }
zle -N fzf-flag-widget zle -N fzf-flag-widget
bindkey '^Q' fzf-flag-widget bindkey '^F' fzf-flag-widget

View File

@ -3,8 +3,8 @@ lua << EOF
require('google.comments').setup { require('google.comments').setup {
-- The command for fetching comments, refer to `get_comments.par --help` to -- The command for fetching comments, refer to `get_comments.par --help` to
-- see all the options. -- see all the options.
-- command = {'/google/bin/releases/editor-devtools/get_comments.par', '--full', '--noresolved', '--json', "-x=''"}, -- command = {'/google/bin/releases/editor-devtools/get_comments.par', '--nofull', '-u', '--json', "-x=''"},
command = {'/google/bin/releases/editor-devtools/get_comments.par', '--nofull', '-u', '--json', "-x=''"}, command = {'/google/bin/releases/editor-devtools/get_comments.par', '--nofull', '--json', '--noresolved', '--cl_comments', '--file_comments', '--unreplied_only'},
-- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`. -- Define your own icon by `vim.fn.sign_define('ICON_NAME', {text = ' '})`.
-- See :help sign_define -- See :help sign_define
-- The sign property passed to setup should be the 'ICON_NAME' in the define -- The sign property passed to setup should be the 'ICON_NAME' in the define
@ -37,4 +37,3 @@ vim.fn.sign_define('COMMENT_ICON', {text = ''})
EOF EOF
autocmd InsertLeave * :lua require('google.comments').update_signs() autocmd InsertLeave * :lua require('google.comments').update_signs()
autocmd FileType * :lua require('google.comments').fetch_comments()

View File

@ -65,12 +65,12 @@ set foldmethod=syntax
let g:clipboard = #{ let g:clipboard = #{
\ name: 'xsel', \ name: 'xsel',
\ copy: { \ copy: {
\ '+': ['xsel', '--nodetach', '-i', '-b'], \ '+': ['xclip', '--nodetach', '-i', '-b'],
\ '*': ['xsel', '--nodetach', '-i', '-p'], \ '*': ['xclip', '--nodetach', '-i', '-p'],
\ }, \ },
\ paste: { \ paste: {
\ '+': ['xsel', '-o', '-b'], \ '+': ['xclip', '-o', '-b'],
\ '*': ['xsel', '-o', '-p'], \ '*': ['xclip', '-o', '-p'],
\ }, \ },
\ cache_enabled: 1, \ cache_enabled: 1,
\ } \ }
@ -100,6 +100,7 @@ call plug#end() " required
" IMPORTANT: Must come after plugins are loaded " IMPORTANT: Must come after plugins are loaded
lua << EOF lua << EOF
-- CiderLSP -- CiderLSP
vim.lsp.set_log_level("trace")
vim.opt.completeopt = { "menu", "menuone", "noselect" } vim.opt.completeopt = { "menu", "menuone", "noselect" }
require 'lspconfig' require 'lspconfig'
@ -154,3 +155,6 @@ colorscheme quantum
let g:airline_theme='quantum' let g:airline_theme='quantum'
set modifiable set modifiable
set omnifunc= completeopt=menuone,noinsert,noselect set omnifunc= completeopt=menuone,noinsert,noselect
let g:lsp_log_verbose = 1
let g:lsp_log_file = expand('~/vim-lsp.log')

View File

@ -119,3 +119,4 @@ alias jadep=/google/data/ro/teams/jade/jadep
alias replace_string=/google/src/head/depot/google3/devtools/scripts/replace_string alias replace_string=/google/src/head/depot/google3/devtools/scripts/replace_string
alias safergcp=/google/bin/releases/safer-gcp/tools/safergcp alias safergcp=/google/bin/releases/safer-gcp/tools/safergcp
alias add_deps_to_usages='/google/src/head/depot/google3/apps/framework/tools/add_deps_to_usages.sh' alias add_deps_to_usages='/google/src/head/depot/google3/apps/framework/tools/add_deps_to_usages.sh'
alias plxutil='/google/data/ro/teams/plx/plxutil'

View File

@ -248,3 +248,19 @@ source ~/zsh-async/async.zsh
export FZF_DEFAULT_OPTS="--preview 'echo {}' --preview-window down:3:wrap --bind ?:toggle-preview" export FZF_DEFAULT_OPTS="--preview 'echo {}' --preview-window down:3:wrap --bind ?:toggle-preview"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
fixup_ssh_auth_sock() {
if [[ -n ${SSH_AUTH_SOCK} && ! -e ${SSH_AUTH_SOCK} ]]
then
local new_sock=$(echo /tmp/ssh-*/agent.*(=UNom[1]))
if [[ -n ${new_sock} ]]
then
export SSH_AUTH_SOCK=${new_sock}
fi
fi
}
if [[ -n ${SSH_AUTH_SOCK} ]]
then
autoload -U add-zsh-hook
add-zsh-hook preexec fixup_ssh_auth_sock
fi

View File

@ -13,7 +13,7 @@ autoload -Uz add-zsh-hook
add-zsh-hook chpwd g3path::hook add-zsh-hook chpwd g3path::hook
g3path::zle::accept-line () { g3path::zle::accept-line () {
if [[ -n $GOOGLE3_ROOT && ! $BUFFER =~ \\s*(blaze|g4|p4|g4d|add_dep|buildozer|build_cleaner|debug_android_lint|rabbit|hb) ]]; then if [[ -n $GOOGLE3_ROOT && ! $BUFFER =~ \\s*(blaze|g4|p4|g4d|add_dep|buildozer|build_cleaner|debug_android_lint|rabbit|hb|gqui) ]]; then
BUFFER=${BUFFER// \/\// $GOOGLE3_ROOT\/} BUFFER=${BUFFER// \/\// $GOOGLE3_ROOT\/}
fi fi
zle .accept-line zle .accept-line