telescope mappings

This commit is contained in:
Christian Nieves
2022-12-27 20:04:37 +00:00
parent f164ec976d
commit 4063d58e4d
4 changed files with 79 additions and 99 deletions

View File

@ -18,7 +18,7 @@ if use_google() then
configs.ciderlsp = { configs.ciderlsp = {
default_config = { default_config = {
cmd = { "/google/bin/releases/cider/ciderlsp/ciderlsp", "--tooltag=nvim-cmp", "--forward_sync_responses" }, cmd = { "/google/bin/releases/cider/ciderlsp/ciderlsp", "--tooltag=nvim-cmp", "--forward_sync_responses" },
filetypes = { "c", "cpp", "java", "kotlin", "objc", "proto", "textproto", "go", "python", "bzl" }, filetypes = { "c", "cpp", "java", "kotlin", "objc", "proto", "textproto", "go", "python", "bzl", "typescript"},
-- root_dir = lspconfig.util.root_pattern("BUILD"), -- root_dir = lspconfig.util.root_pattern("BUILD"),
root_dir = function(fname) root_dir = function(fname)
return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$') return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$')
@ -30,7 +30,7 @@ if use_google() then
configs.analysislsp = { configs.analysislsp = {
default_config = { default_config = {
cmd = { '/google/bin/users/lerm/glint-ale/analysis_lsp/server', '--lint_on_save=false', '--max_qps=10' }, cmd = { '/google/bin/users/lerm/glint-ale/analysis_lsp/server', '--lint_on_save=false', '--max_qps=10' },
filetypes = { "c", "cpp", "java", "kotlin", "objc", "proto", "textproto", "go", "python", "bzl" }, filetypes = { "c", "cpp", "java", "kotlin", "objc", "proto", "textproto", "go", "python", "bzl", "markdown","typescript", "javascript"},
-- root_dir = lspconfig.util.root_pattern('BUILD'), -- root_dir = lspconfig.util.root_pattern('BUILD'),
root_dir = function(fname) root_dir = function(fname)
return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$') return string.match(fname, '(/google/src/cloud/[%w_-]+/[%w_-]+/google3/).+$')

View File

@ -1,3 +1,5 @@
local use_google = require("utils").use_google
require('telescope').setup { require('telescope').setup {
defaults = { defaults = {
-- The vertical layout strategy is good to handle long paths like those in -- The vertical layout strategy is good to handle long paths like those in
@ -40,6 +42,7 @@ require('telescope').setup {
local map = require("utils").map local map = require("utils").map
if use_google() then
-- These custom mappings let you open telescope-codesearch quickly: -- These custom mappings let you open telescope-codesearch quickly:
map('n', '<C-P>', map('n', '<C-P>',
[[<cmd>lua require('telescope').extensions.codesearch.find_files{}<CR>]], [[<cmd>lua require('telescope').extensions.codesearch.find_files{}<CR>]],
@ -53,14 +56,6 @@ map(
[[<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 }
) )
--
-- Search for files using codesearch queries.
map(
"n",
"<leader>cf",
[[<cmd>lua require('telescope').extensions.codesearch.find_files{}<CR>]],
{ noremap = true, silent = true }
)
-- Search for the word under cursor. -- Search for the word under cursor.
map( map(
@ -70,14 +65,6 @@ map(
{ noremap = true, silent = true } { noremap = true, silent = true }
) )
-- Search for a file having word under cursor in its name.
map(
"n",
"<leader>CF",
[[<cmd>lua require('telescope').extensions.codesearch.find_files{default_text_expand='<cword>'}<CR>]],
{ noremap = true, silent = true }
)
-- Search for text selected in Visual mode. -- Search for text selected in Visual mode.
map( map(
"v", "v",
@ -86,19 +73,13 @@ map(
{ noremap = true, silent = true } { noremap = true, silent = true }
) )
-- Search for file having text selected in Visual mode. -- map("n",
map( -- "<leader>ps",
"v", -- [[:Telescope find_files find_command=hg,pstatus,-ma,-n,--template=<CR>]])
"<leader>cf",
[[<cmd>lua require('telescope').extensions.codesearch.find_files{}<CR>]],
{ noremap = true, silent = true }
)
map("n", map("n", "<leader>tw", ":Telescope citc workspaces<CR>")
"<leader>ps", map("n", "<leader>tm", ":Telescope citc modified<CR>")
[[:Telescope find_files find_command=hg,pstatus,-ma,-n,--template=<CR>]]) map("n", "<leader>tb", ":Telescope file_browser<CR>")
map("n", "<leader>tf", ":lua require('telescope').extensions.frecency.frecency({ workspace = 'CWD' })<CR>", {noremap = true, silent = true})
map( "n", "<space>tb", ":Telescope file_browser")
map( "n", "<space>fb", ":Telescope file_browser")
map("n", "<leader><leader>", "<Cmd>lua require('telescope').extensions.frecency.frecency({ workspace = 'CWD' })<CR>", {noremap = true, silent = true})
end

View File

@ -131,15 +131,12 @@ require('packer').startup(function(use)
end end
} }
use {
'sso://googler@user/vintharas/telescope-codesearch.nvim',
disable = not use_google(),
}
use { use {
'sso://googler@user/piloto/cmp-nvim-ciderlsp', 'sso://googler@user/piloto/cmp-nvim-ciderlsp',
'sso://googler@user/kdark/ciderlsp-nvim', 'sso://googler@user/kdark/ciderlsp-nvim',
'sso://googler@user/vintharas/telescope-codesearch.nvim',
'sso://googler@user/aktau/telescope-citc.nvim',
disable = not use_google(), disable = not use_google(),
} }

View File

@ -183,3 +183,5 @@ nnoremap <leader>ws :CorpWebCs <cword> <CR>
nnoremap <leader>wf :CorpWebCsFile<CR> nnoremap <leader>wf :CorpWebCsFile<CR>
nmap <leader>rbs ss <leader>rb nmap <leader>rbs ss <leader>rb
nmap <leader>yb :let @" = join(blaze#GetTargets(), ' ')<cr>