From fdcbc48713e19fa18a7f16e4338a795a57bc1be7 Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Fri, 7 Jul 2023 11:40:46 -0700 Subject: [PATCH] UI changes + treesitter --- README.md | 4 ++++ conf/langs/general.vim | 46 ++++++++++++++++++++++++++++++++++++++++++++++ conf/plugins.vim | 4 ++++ conf/ui.vim | 1 + 4 files changed, 55 insertions(+) create mode 100644 conf/langs/general.vim diff --git a/README.md b/README.md index e464c10..b943013 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ through the use of `vimux` and `vim-tmux-navigator`. 3. [Monospaced Nerd Font](https://www.nerdfonts.com/font-downloads) - The `/font` directory has one I use. 4. `tmux` +## Updating + +After running `git pull` you may need to run `:PlugInstall` and restart neovim to resolve any errors. + For Python editing: 1. [Neovim](https://github.com/neovim/neovim) compiled with Python support. diff --git a/conf/langs/general.vim b/conf/langs/general.vim new file mode 100644 index 0000000..5aca597 --- /dev/null +++ b/conf/langs/general.vim @@ -0,0 +1,46 @@ +" General configuration +let g:ale_fixers = { + \ '*': ['remove_trailing_lines', 'trim_whitespace'], + \ 'python': ['black', 'flake8'], + \ 'c': ['clang-format'], + \ 'c++': ['clang-format'] + \} + +let g:ale_fix_on_save = 1 + +"" Treesitter config. +"" TODO: Remove lua << EOF and EOF when all files are converted +"" to lua. +lua << EOF +require'nvim-treesitter.configs'.setup { + ensure_installed = { + "c", + "lua", + "markdown", + "python", + "query", + "vim", + "vimdoc", + }, + + -- Prefer asynchronous install for ensure_installed. + sync_install = false, + auto_install = true, + + highlight = { + enable = true, + + -- Disable for excessively large files. + disable = function(lang, buf) + local max_filesize = 100 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + + -- Disable vim regex highlighting. May intefer with some `indent` style stuff. + additional_vim_regex_highlighting = false, + }, +} +EOF diff --git a/conf/plugins.vim b/conf/plugins.vim index 104f90e..131010a 100644 --- a/conf/plugins.vim +++ b/conf/plugins.vim @@ -18,6 +18,10 @@ Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'ryanoasis/vim-devicons' Plug 'preservim/nerdtree' +"" This plugin has been archived so if there are problems +"" They may emerge here +Plug 'Xuyuanp/nerdtree-git-plugin' +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " General Editing Plug 'tpope/vim-surround' diff --git a/conf/ui.vim b/conf/ui.vim index 2454323..3e965ab 100644 --- a/conf/ui.vim +++ b/conf/ui.vim @@ -15,3 +15,4 @@ endif let NERDTreeShowHidden=1 +