From d10da3b71a23fc578d83218357b3dd87a3c44e6c Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Mon, 7 Feb 2022 12:14:24 -0800 Subject: [PATCH] fish path and add treesitter --- .config/fish/config.fish | 2 +- .vim/nvim.lua | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ .vimrc | 2 ++ 3 files changed, 60 insertions(+), 1 deletion(-) diff --git a/.config/fish/config.fish b/.config/fish/config.fish index a271bc3..649d657 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -1,4 +1,4 @@ -set PATH ~/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH +set PATH ~/bin ~/.local/bin ~/.go/bin ~/.cargo/bin /bin /sbin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ~/.cabal/bin /usr/lib/go/bin ~/.gem/ruby/1.9.1/bin $PATH set fish_greeting "" set EDITOR vi diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 6d6f7ae..3246572 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -256,6 +256,60 @@ local dropdown = require'telescope.themes'.get_dropdown({ --winblend = 10 }) +-- +-- Treesitter +-- + +require'nvim-treesitter.configs'.setup { + -- One of "all", "maintained" (parsers with maintainers), or a list of languages + ensure_installed = { + "c", + "rust", + "python", + "go", + "javascript", + "typescript", + "markdown", + "fish", + "css", + "json", + "lua", + "make", + "svelte", + "vim", + "yaml", + }, + + -- Install languages synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- List of parsers to ignore installing + -- ignore_install = { "javascript" }, + + highlight = { + -- `false` will disable the whole extension + enable = true, + + -- list of language that will be disabled + disable = { "c", "rust" }, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, + + indent = { + enable = true + }, +} + + +-- +-- Helper functions for my own grepping commands. +-- + live_grep_repo = function(conf) --local opt = dropdown local opt = { @@ -275,6 +329,9 @@ git_grep_word = function(conf) end +--- +--- My own "where" clause generator for Rust +--- function string.insert(str1, str2, pos) return str1:sub(1,pos)..str2..str1:sub(pos+1) end diff --git a/.vimrc b/.vimrc index 651f0a7..58df56e 100644 --- a/.vimrc +++ b/.vimrc @@ -223,6 +223,8 @@ Plug 'folke/trouble.nvim' Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'kristijanhusak/defx-icons' +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} + "Plug 'ggandor/lightspeed.nvim' Plug 'justinmk/vim-sneak'