Skip to content

Commit

Permalink
play with nvim-treesitter
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanshelly committed Feb 27, 2021
1 parent 914b730 commit 2054cf4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
8 changes: 7 additions & 1 deletion neovim/filetype_specific.vim
Expand Up @@ -29,7 +29,13 @@ augroup END
augroup filetype_vim
autocmd!
autocmd Filetype vim set textwidth=80
autocmd BufRead,BufNewFile *.nvim setfiletype vim
autocmd BufRead,BufNewFile *.nvim setlocal filetype=vim
augroup END

" TODO: avoid needing to do this manually
augroup filetype_nix
autocmd!
autocmd BufRead,BufNewFile *.nix setlocal filetype=nix
augroup END

augroup filetype_json
Expand Down
14 changes: 14 additions & 0 deletions neovim/plugin_config.vim
Expand Up @@ -150,3 +150,17 @@ nnoremap <leader>ch :ColorHighlight<CR>
" highlight only color codes, not color names - '#ffffff' not 'white'
let g:colorizer_colornames = 0

" <<<< treesitter >>>>

" ref - https://github.com/nvim-treesitter/nvim-treesitter#modules
lua <<EOF
require'nvim-treesitter.configs'.setup {
-- "all", "maintained" (parsers with maintainers), or a list of languages
ensure_installed = "maintained",
highlight = { enable = true },
incremental_selection = { enable = true },
indent = { enable = true },
playground = { enable = true }
}
EOF
8 changes: 4 additions & 4 deletions neovim/plugins.vim
Expand Up @@ -57,10 +57,6 @@ Plug 'sonph/onehalf', {'rtp': 'vim/'}
" jsonc filetype - JSON w/ comments
Plug 'neoclide/jsonc.vim'

" individual languages/syntax
Plug 'peitalin/vim-jsx-typescript'
Plug 'styled-components/vim-styled-components', { 'branch': 'main' }

" highlight color codes with their color
" run `:ColorHighlight` to see #FF00AA with a hot pink background
Plug 'chrisbra/Colorizer'
Expand All @@ -69,4 +65,8 @@ Plug 'chrisbra/Colorizer'
" insert color from color picker
Plug 'kabbamine/vCoolor.vim'

" We recommend updating the parsers on update
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/playground'

call plug#end()
8 changes: 1 addition & 7 deletions nix/editor.nix
Expand Up @@ -88,13 +88,7 @@
# << colors/syntax/languages >>

# statusline color scheme
onehalf

# language pack
vim-polyglot

# individual languages/syntax
vim-markdown
# onehalf

# TODO: allow unsupported systems?
# insert color from color picker
Expand Down

0 comments on commit 2054cf4

Please sign in to comment.