1
Fork 0

feat: treesitter plugin for neovim

This commit is contained in:
Matei Adriel 2022-02-01 12:02:02 +02:00
parent 9b1defa428
commit 85cc99140c
4 changed files with 41 additions and 22 deletions

View file

@ -1,35 +1,33 @@
local cmd = vim.cmd -- to execute Vim commands e.g. cmd('pwd')
local fn = vim.fn -- to call Vim functions e.g. fn.bufnr()
local g = vim.g -- a table to access global variables
local opt = vim.opt -- to set options
local cmd = vim.cmd -- to execute Vim commands e.g. cmd('pwd')
local fn = vim.fn -- to call Vim functions e.g. fn.bufnr()
local g = vim.g -- a table to access global variables
local opt = vim.opt -- to set options
-- Basic options
opt.joinspaces = false -- No double spaces with join
opt.list = true -- Show some invisible characters
opt.joinspaces = false -- No double spaces with join
opt.list = true -- Show some invisible characters
opt.number = true -- Show line numbers
opt.relativenumber = true -- Relative line numbers
opt.number = true -- Show line numbers
opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 4 -- Lines of context
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.termguicolors = true -- True color support
opt.scrolloff = 4 -- Lines of context
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.termguicolors = true -- True color support
opt.ignorecase = true -- Ignore case
opt.smartcase = true -- Do not ignore case with capitals
opt.ignorecase = true -- Ignore case
opt.smartcase = true -- Do not ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.smartindent = true -- Insert indents automatically
opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
opt.wrap = false -- Disable line wrap
opt.wildmode = {'list', 'longest'} -- Command-line completion mode
opt.wrap = false -- Disable line wrap
opt.wildmode = {'list', 'longest'} -- Command-line completion mode
-- Set theme
require('github-theme').setup({
theme_style = "light"
})
require('github-theme').setup({theme_style = "light", dark_float = true})
-- Import my other files
require('my.keymaps').setup()

View file

@ -3,6 +3,7 @@ local M = {}
function M.setup()
require("my.plugins.lspconfig").setup()
require("my.plugins.fzf-lua").setup()
require("my.plugins.treesitter").setup()
-- Other unconfigured plugins
require('nvim-autopairs').setup()

View file

@ -0,0 +1,19 @@
local M = {}
function M.setup()
require'nvim-treesitter.configs'.setup {
ensure_installed = "maintained",
sync_install = false,
highlight = {
enable = true,
-- 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
}
}
end
return M

View file

@ -39,6 +39,7 @@ in
fzf-lua # fuzzy search for say opening files
purescript-vim # purescript syntax highlighting
nvim-comment # allows toggling line-comments
nvim-treesitter # use treesitter for syntax highlighting
];
};
}