dotfiles/config/nvim/init.vim
2023-01-17 12:25:23 +02:00

65 lines
1.4 KiB
VimL

" Load plugins
call plug#begin()
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'https://gitlab.com/code-stats/code-stats-vim.git', {'do': ':TSUpdate'}
Plug 'vim-airline/vim-airline', {'do': ':TSUpdate'}
call plug#end()
" Python plugins, needed for CodeStats
" let g:python3_host_prog = '/usr/bin/python'
" CodeStats
let g:codestats_api_key = $CODESTATS_API_KEY
" Main configuration
set tabstop=2 softtabstop=2 shiftwidth=2 expandtab smarttab autoindent
set mouse=
set laststatus=2
set t_Co=256
lua <<EOF
require 'nvim-treesitter.configs'.setup {
ensure_installed = {
"bash", "vim", "regex",
"cpp", "go", "rust",
"diff", "make",
"dockerfile",
"elixir", "erlang",
"godot_resource", "gdscript",
"git_rebase", "gitattributes", "gitcommit", "gitignore",
"html", "scss",
"http", "sql",
"javascript", "jsdoc", "typescript", "vue",
"json", "json5", "jq",
"lua", "php", "phpdoc",
"markdown", "markdown_inline",
"rst", "yaml",
},
highlight = {
enable = true
}
}
local parser_config = require'nvim-treesitter.parsers'.get_parser_configs()
parser_config.dfraw = {
install_info = {
url = 'https://code.criminallycute.fi/github-mirror/tree-sitter-dfraw',
files = { 'src/parser.c' },
branch = 'main'
},
filetype = 'text',
used_by = { 'dfraw' }
}
EOF
" disable dfraw for text files
if did_filetype()
finish
endif
if getline(1) =~# '[a-z_]'
setfiletype dfraw
endif