From 184c86db9e9ecc7811955f223063f620be8ea9b6 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Tue, 3 Jan 2023 15:59:56 +0100 Subject: [PATCH] (vim) Consolidate telescope configuration --- .config/nvim/init.lua | 2 + .config/nvim/legacy.vim | 195 ++++++++++++++++++++++++++ .config/nvim/lua/telescope-config.lua | 13 ++ 3 files changed, 210 insertions(+) create mode 100644 .config/nvim/init.lua create mode 100644 .config/nvim/legacy.vim create mode 100644 .config/nvim/lua/telescope-config.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua new file mode 100644 index 0000000..f20c91a --- /dev/null +++ b/.config/nvim/init.lua @@ -0,0 +1,2 @@ +vim.cmd("source ~/.config/nvim/legacy.vim") + diff --git a/.config/nvim/legacy.vim b/.config/nvim/legacy.vim new file mode 100644 index 0000000..87a8420 --- /dev/null +++ b/.config/nvim/legacy.vim @@ -0,0 +1,195 @@ +call plug#begin('~/.config/nvim/plugged') +" Ayu color scheme +Plug 'TanguyHerbron/ayu-vim' + +Plug 'junegunn/fzf.vim' + +" Display indents +Plug 'yggdroot/indentline' + +Plug 'yuezk/vim-js' + +" Autocompletion +Plug 'neoclide/coc.nvim', {'branch': 'release'} + +Plug 'vim-airline/vim-airline' +Plug 'ryanoasis/vim-devicons' + +" File finder and live grep +Plug 'nvim-telescope/telescope.nvim', {'branch': '0.1.x'} +Plug 'nvim-lua/plenary.nvim' +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + +" Grep utility for whole project +Plug 'jremmen/vim-ripgrep' +" Git integration +Plug 'tpope/vim-fugitive' + +Plug 'rrethy/vim-hexokinase', {'do': 'make hexokinase'} +" Ctrl-z tree still history manager +Plug 'mbbill/undotree' + +" docker-compose wrapper +Plug 'skanehira/docker-compose.vim' + +" Nginx syntax highlighter +Plug 'chr4/nginx.vim' + +" Highlight indicator +Plug 'machakann/vim-highlightedyank' + +" Markdown preview in browser +Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} + +"" Markdown table formatter +"Plug 'junegunn/vim-easy-align' + +" Markdown formatting +Plug 'godlygeek/tabular' +Plug 'preservim/vim-markdown' + +" React syntax highlighter + +" i3 config checker +Plug 'mboughaba/i3config.vim' + +" Session restore +Plug 'tpope/vim-obsession' + +" Testing disable section +"" Deprecated, replace by coc feature ? +" Plug 'lervag/vimtex' +" Plug 'ekalinin/Dockerfile.vim' + +" Vim integration in tmux +Plug 'vimpostor/vim-tpipeline' +call plug#end() + +" Disable integrated providers +let g:loaded_ruby_provider = 0 +let g:loaded_perl_provider = 0 +let g:loaded_node_provider = 0 + +syntax on + +set noerrorbells +filetype plugin indent on +" show existing tab with 4 spaces width +set tabstop=4 softtabstop=4 +" when indenting with '>', use 4 spaces width +set shiftwidth=4 +" on pressng tab, insert 4 spaces +set expandtab +set smartindent +set nu +set nowrap +set smartcase +set noswapfile +set nobackup +set undodir=~/.config/nvim/undodir +set undofile +set incsearch + +set splitright +set splitbelow + +" Remove the duplicate --INSERT-- information +set noshowmode + +" rg smart root founder and adds git ignore loading for faster execution +if executable('rg') + let g:rg_derive_root="true" +endif + +" let g:airline_powerline_fonts = 1 + +source ~/.config/nvim/coc.vim + +let mapleader = " " + +nnoremap h :wincmd h +nnoremap j :wincmd j +nnoremap k :wincmd k +nnoremap l :wincmd l +nnoremap u :UndotreeToggle + +nnoremap 1 1gt +nnoremap 2 2gt +nnoremap 3 3gt +nnoremap 4 4gt +nnoremap 5 5gt +nnoremap 6 6gt +nnoremap 7 7gt +nnoremap 8 8gt +nnoremap 9 9gt +nnoremap 0 10gt + +nnoremap lua require"telescope-config".project_files() +nnoremap Telescope live_grep + +" Add folding shortcuts and settings +set foldmethod=indent +set foldnestmax=10 +set nofoldenable +set foldlevel=99 +set signcolumn=no + +" indentline configs +let g:indentLine_enabled = 1 +let g:indentLine_char_list = ['|', '¦', '┆', '┊'] +let g:indentLine_setColors = 1 +let g:indentLine_color_gui = "#5C6370" +let g:indentLine_showFirstIndentLevel = 1 + +" vimtex settings +let g:tex_flavor = 'latex' +let g:vimtex_view_method = 'zathura' +let g:vimtex_compiler_latexmk = { + \'build_dir': 'build', + \} + +let &t_8f = "\[38;2;%lu;%lu;%lum" +let &t_8b = "\[48;2;%lu;%lu;%lum" + +set background=dark +set t_Co=256 + +" Ayu colors scheme settings +set termguicolors +let ayucolor="mirage" +colorscheme ayu + +" Syntastic default configuration +set statusline+=%#warningmsg# +set statusline+=%{SyntasticStatuslineFlage()} +set statusline+=%* + +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_auto_loc_list = 1 +let g:syntastic_check_on_open = 1 +let g:syntastic_check_on_wq = 0 + +" Neomutt configuration for nvim compatibility +au BufRead /tmp/neomutt-* set tw=72 + +" Line wrapping shortcuts +function! ToggleWrap() + set wrap! linebreak! nolist! +endfunction + +nnoremap w :call ToggleWrap() + +" Python configuration, Highlight self +augroup python + autocmd! + autocmd FileType python + \ syn keyword pythonSelf self + \ | highlight def link pythonSelf Special + +augroup end + +" Markdown formatter macro +nnoremap t :TableFormat + +let g:coc_disable_startup_warning = 1 +set mouse= diff --git a/.config/nvim/lua/telescope-config.lua b/.config/nvim/lua/telescope-config.lua new file mode 100644 index 0000000..3319b7c --- /dev/null +++ b/.config/nvim/lua/telescope-config.lua @@ -0,0 +1,13 @@ +local M = {} + +M.project_files = function() + local opts = {} + vim.fn.system('git rev-parse is-inside-work-tree') + if vim.v.shell_error == 0 then + require"telescope.builtin".git_files({git_command={"git","ls-files","--exclude-standard","--cached","--other"}}) + else + require"telescope.builtin".find_files(opts) + end +end + +return M