From 63a8fb34ae4816a3122b266bc17be3a8fb2cb409 Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Thu, 27 Jan 2022 15:24:12 -0500 Subject: [PATCH] tree sitter, lots of changes: --- config/nvim/init.vim | 91 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 9 deletions(-) diff --git a/config/nvim/init.vim b/config/nvim/init.vim index de2eae6..8288513 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -2,6 +2,7 @@ syntax enable let mapleader = " " call plug#begin('~/.vim/plugged') + Plug 'ludovicchabant/vim-gutentags' Plug 'ervandew/supertab' Plug 'preservim/nerdtree' Plug 'liuchengxu/space-vim-dark' @@ -13,19 +14,30 @@ call plug#begin('~/.vim/plugged') Plug 'airblade/vim-gitgutter' Plug 'majutsushi/tagbar' Plug 'vim-airline/vim-airline' - " Plug 'ctrlpvim/ctrlp.vim' " Replaced with telescope Plug 'enricobacis/vim-airline-clock' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'thoughtbot/vim-rspec' Plug 'voldikss/vim-floaterm' Plug 'fatih/vim-go' + Plug 'folke/which-key.nvim' + Plug 'whatyouhide/vim-gotham' + Plug 'nanotech/jellybeans.vim' + Plug 'sickill/vim-monokai' + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} call plug#end() +lua << EOF + require("which-key").setup { + } +EOF + map :NERDTreeToggle +map v :WhichKey + set tabstop=2 -set shell=/bin/bash +set shell=/bin/zsh set shiftwidth=2 set expandtab set hidden @@ -41,7 +53,7 @@ endif colorscheme space-vim-dark hi Comment cterm=italic -" Relative numbers and when not in buiffer set absolute numbers +" Relative numbers and when not in buffer set absolute numbers set number relativenumber augroup numbertoggle autocmd! @@ -56,8 +68,8 @@ nnoremap Q " Search with Ag nnoremap / :Ag -nnoremap :bnext -nnoremap :bprev +nnoremap :bnext +nnoremap :bprev nmap bq :bp bd # "Clock @@ -67,7 +79,13 @@ let g:airline#extensions#clock#format = '%I:%M:%S %X' nnoremap ff Telescope find_files nnoremap fg Telescope live_grep nnoremap fb Telescope buffers +nnoremap fa Ag " nnoremap ft Telescope help_tags +"lua << EOF +"require('telescope').setup{ +" file_ignore_patterns = {"node_modules","./venv/"}, +"} +"EOF " RSpec.vim mappings map rt :call RunCurrentSpecFile() @@ -75,11 +93,66 @@ map rs :call RunNearestSpec() map rl :call RunLastSpec() map ra :call RunAllSpecs() -let g:python_host_prog = '~/.nvim.pythonenv2/bin/python' -let g:python3_host_prog = '~/.nvim.pythonenv/bin/python' +" let g:python_host_prog = '~/.nvim.pythonenv2/bin/python' +if exists("$VIRTUAL_ENV") + let g:python3_host_prog=substitute(system("which -a python3 | head -n2 | tail -n1"), "\n", '', 'g') +else + let g:python3_host_prog=substitute(system("which python3"), "\n", '', 'g') +endif " Floaterm let g:floaterm_keymap_toggle = '' -let g:floaterm_width = 0.85 -let g:floaterm_height = 0.85 +let g:floaterm_width = 0.9 +let g:floaterm_height = 0.9 + +" Line Numbers +set number relativenumber " Turn line numbering on at startup +noremap :set invnumber invrelativenumber + +"Tagbar +" +noremap :Tagbar + + +" Syntax Colors +function! SynStack () + for i1 in synstack(line("."), col(".")) + let i2 = synIDtrans(i1) + let n1 = synIDattr(i1, "name") + let n2 = synIDattr(i2, "name") + echo n1 "->" n2 + endfor +endfunction + + +" TreeSitter +lua <