Skip to content

Commit

Permalink
neovim 0.10.0: Revamp colors, airline, and bufferline
Browse files Browse the repository at this point in the history
My gruvbox and airline colors broke with Neovim 0.10.0.

* morhetz/gruvbox#459
* https://neovim.io/doc/user/news-0.10.html

To fix it, I had to ditch the unmaintained gruvbox theme and switched to
a lua-based gruvbox theme: ellisonleao/gruvbox.nvim

To fix airline's colors, I had to switch to a lua-based airline plugin:
lualine. I don't like lualine's bufferline implementation, so I added
akinsho/bufferline.nvim to handle my bufferline.

This also switches to using nvim-treesitter for all syntax highlighting.
  • Loading branch information
natemccurdy committed May 21, 2024
1 parent d1d416b commit de5c65a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 48 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ I use [Homebrew Bundle](https://github.com/Homebrew/homebrew-bundle) for most of

GruvBox iTerm2 color scheme. Download it, open it, then set it as your profile's color scheme: <https://github.com/morhetz/gruvbox-contrib/raw/master/iterm2/gruvbox-dark.itermcolors>

I use the "MesoLGS Nerd Font" in iTerm2 which is in the `/Meslo/MesloLGSNerdFont-Regular.ttf` file from the `Meslo.tar.xz` release archive.

I use the MesloLG Nerd fonts:

1. https://www.nerdfonts.com/font-downloads -- https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3/Meslo.zip
1. https://www.nerdfonts.com/font-downloads -- https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/Meslo.tar.xz

![](screenshots/iterm_text_options.png)

Expand Down
15 changes: 5 additions & 10 deletions home/.vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,28 @@ if empty(glob(data_dir . '/autoload/plug.vim'))
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

" PolyGot Settings
" For some reason polyglot requires this before loading the plugin :'(
"let g:polyglot_disabled = ['puppet', 'python', 'python-indent', 'python-compiler']
let g:polyglot_disabled = ['puppet']

" Vim Plug start
call plug#begin(data_dir.'/plugged')

" GitHub plugins
Plug 'CopilotC-Nvim/CopilotChat.nvim', { 'branch': 'canary' }
Plug 'Valloric/ListToggle'
Plug 'airblade/vim-gitgutter'
Plug 'bling/vim-airline'
Plug 'akinsho/bufferline.nvim', { 'tag': '*' }
Plug 'dense-analysis/ale'
Plug 'ellisonleao/gruvbox.nvim'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'github/copilot.vim'
Plug 'godlygeek/tabular'
Plug 'hashivim/vim-terraform'
Plug 'jjo/vim-cue'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'morhetz/gruvbox'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-lualine/lualine.nvim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'preservim/nerdtree'
Plug 'rodjek/vim-puppet'
Plug 'ryanoasis/vim-devicons'
Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-fugitive'

call plug#end()
Expand Down
85 changes: 50 additions & 35 deletions home/.vimrc.settings
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,54 @@ colorscheme gruvbox
"}}}
" PLUGIN OPTIONS {{{

"vim-airline options
set laststatus=2
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#tabline#show_tab_type = 0
let g:airline#extensions#tabline#buffer_min_count = 1
let g:airline_skip_empty_sections = 1
let g:airline#parts#ffenc#skip_expected_string='utf-8[unix]'
let g:airline#extensions#branch#vcs_checks = [] " Prevent unnecessary 'git status' calls.

" vim-markdown settings
let g:markdown_include_jekyll_support = 0
" NOTE: inline lua heredocs break syntax highlighting for vimscript. Fix it by
" running the following from within vim:
" !curl -sS https://raw.githubusercontent.com/neovim/neovim/v0.7.2/runtime/syntax/lua.vim > $VIMRUNTIME/syntax/lua.vim
" See: https://github.com/neovim/neovim/issues/20456

" https://github.com/nvim-lualine/lualine.nvim
lua << EOF
require('lualine').setup {
options = {
theme = 'gruvbox',
},
sections = {
lualine_c = {
-- https://github.com/nvim-lualine/lualine.nvim?tab=readme-ov-file#filename-component-options
{ 'filename', path = 1 }
},
},
extensions = {
'fugitive',
'quickfix',
'nerdtree'
}
}
EOF

" https://github.com/akinsho/bufferline.nvim
" :h bufferline-configuration
lua << EOF
require("bufferline").setup{
options = {
show_buffer_close_icons = false,
separator_style = "slant",
}
}
EOF

" https://github.com/nvim-treesitter/nvim-treesitter
lua << EOF
require('nvim-treesitter.configs').setup {
-- Automatically install missing parsers when entering buffer.
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- Use treesitter highlighting.
highlight = {
enable = true,
},
}
EOF

" allows cursor change in tmux mode
if exists('$TMUX')
Expand All @@ -62,17 +97,10 @@ else
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif

" Git Gutter
highlight GitGutterAdd ctermbg=235 ctermfg=10
highlight GitGutterChange ctermbg=235 ctermfg=208
highlight GitGutterDelete ctermbg=235 ctermfg=9
highlight GitGutterChangeDelete ctermbg=235 ctermfg=175

" vim-go
let g:go_template_autocreate = 0 " Disable auto-creation of template files

" ALE Options
let g:airline#extensions#ale#enabled = 1 " Use the vim-airline integration
let g:ale_completion_enabled = 1
let g:ale_go_golangci_lint_package = 1 " Run golangci-lint on the entire Go package
let g:ale_lint_on_save = 0
Expand Down Expand Up @@ -117,8 +145,7 @@ let g:python_highlight_all = 1
" https://github.com/CopilotC-Nvim/CopilotChat.nvim
lua << EOF
require("CopilotChat").setup {
debug = true, -- Enable debugging
-- See Configuration section for rest
debug = true,
}
EOF

Expand Down Expand Up @@ -187,20 +214,8 @@ augroup HighlightProblems
\ call AddLiteralTabMatch()
augroup END

" Highlight Colors
highlight Default ctermfg=1
" Darker vertical line between splits.
highlight vertsplit ctermbg=235 ctermfg=239
" Darker line numbers.
highlight LineNr ctermfg=239
" Highlight search terms with orange.
highlight Search ctermbg=235 ctermfg=166
" Hide the sign column.
highlight SignColumn ctermbg=235
" Hide the rows of '~' at the end of a document.
highlight EndOfBuffer ctermbg=235 ctermfg=235
"highlight StatusLine ctermbg=245 ctermfg=235
"highlight StatusLineNC ctermbg=237 ctermfg=235
highlight Search ctermbg=235 ctermfg=166

" New vertical splits go to the right rather than the left
set splitright
Expand Down

0 comments on commit de5c65a

Please sign in to comment.