diff --git a/.vim/nvim.lua b/.vim/nvim.lua index f31be04..90b225a 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -275,16 +275,25 @@ require('trouble').setup { } local trouble_telescope = require("trouble.providers.telescope") +local builtin = require 'telescope.builtin' + +local sendtoqf = function(loc) + local actions = require('telescope.actions') + actions.send_to_qflist(loc) + builtin.quickfix({ initial_mode = "normal" }) +end require('telescope').setup { defaults = { mappings = { n = { ["q"] = require('telescope.actions').close, + ["ff"] = sendtoqf, [""] = trouble_telescope.open_with_trouble, }, i = { [""] = trouble_telescope.open_with_trouble, + ["ff"] = require('telescope.actions').send_to_qflist, }, }, }, @@ -307,10 +316,15 @@ require('telescope').setup { height = 15, }, }, + quickfix = { + theme = "ivy", + layout_config = { + height = 15, + }, + }, }, } -local builtin = require 'telescope.builtin' local dropdown = require 'telescope.themes'.get_dropdown({ --previewer = false, @@ -376,8 +390,8 @@ require 'nvim-treesitter.configs'.setup { -- Instead of true it can also be a list of languages additional_vim_regex_highlighting = false, --custom_captures = { - --["generic_type_param"] = "TSCGenericTypeParam", - --["type_identifier"] = "TSCGenericTypeParam", + --["generic_type_param"] = "TSCGenericTypeParam", + --["type_identifier"] = "TSCGenericTypeParam", --}, }, @@ -448,6 +462,12 @@ file_list = function(conf) builtin.git_files(opt) end +--quickfix_telescope = function(conf) +--local opt = telescope_ivy +--for k, v in pairs(conf) do opt[k] = v end +--builtin.quickfix(opt) +--end + --- --- My own "where" clause generator for Rust diff --git a/.vimrc b/.vimrc index 945e6a1..f8aec23 100644 --- a/.vimrc +++ b/.vimrc @@ -198,7 +198,7 @@ Plug 'zchee/vim-goasm' "\ } "Plug 'ensime/ensime-vim', { 'do': ':UpdateRemotePlugins' } "Plug 'neoclide/coc.nvim', {'branch': 'release'} -Plug 'romainl/vim-qf' +"Plug 'romainl/vim-qf' Plug 'neovim/nvim-lspconfig' Plug 'nvim-lua/lsp_extensions.nvim' Plug 'hrsh7th/nvim-compe' @@ -296,8 +296,8 @@ set updatetime=500 autocmd CursorHold * lua vim.diagnostic.open_float({focusable = false}) " Autoformat on save -autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 1000) -autocmd BufWritePre *.py lua vim.lsp.buf.formatting_sync(nil, 1000) +autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_seq_sync(nil, 1000) +autocmd BufWritePre *.py lua vim.lsp.buf.formatting_seq_sync(nil, 1000) autocmd BufWritePre *.rs lua vim.lsp.buf.formatting_seq_sync(nil, 1000) autocmd BufWritePre *.go lua vim.lsp.buf.formatting_seq_sync(nil, 1000) autocmd BufWritePre *.go silent! lua org_imports(3000) @@ -320,12 +320,12 @@ inoremap compe#scroll({ 'delta': -4 }) -let g:qf_auto_open_quickfix = 1 -let g:qf_auto_open_loclist = 0 +"let g:qf_auto_open_quickfix = 1 +"let g:qf_auto_open_loclist = 0 -nmap (qf_qf_previous) -nmap (qf_qf_next) -nmap ge (qf_qf_toggle) +"nmap (qf_qf_previous) +"nmap (qf_qf_next) +"nmap ge (qf_qf_toggle) "" Sources "source ~/.vim/supertab.vim @@ -1015,6 +1015,7 @@ nnoremap aa :RgRoot! nnoremap lua file_list{} nnoremap ag lua live_grep_repo{ word_match = "-w", only_sort_text = true, search = ''} nnoremap aw lua git_grep_word{ word_match = "-w", only_sort_text = true, initial_mode = "normal" } +nnoremap q lua require('telescope.builtin').quickfix{ initial_mode = "normal" } " For C++ -- A is a great plugin which allows you to jump from the c file to the " header and vice-versa. Mneumonic here is headerheader.