Skip to content

Commit 2c0956c

Browse files
author
james
committed
linting and highlight
1 parent 705357a commit 2c0956c

File tree

3 files changed

+65
-3
lines changed

3 files changed

+65
-3
lines changed
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
alias jianostack="cd ~/Sites/jianostack.github.io && nvim ."
2-
31
alias vim="nvim"
42

53
alias Sites="cd ~/Sites"

dotfiles/.config/nvim/init.vim

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ call plug#begin()
1414
Plug 'nvim-lua/plenary.nvim'
1515
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.8' }
1616
Plug 'ellisonleao/gruvbox.nvim'
17+
Plug 'nvim-treesitter/nvim-treesitter', { 'do': ':TSUpdate' }
18+
Plug 'dense-analysis/ale'
1719
call plug#end()
1820

1921
nnoremap <leader>ff <cmd>Telescope find_files<cr>
@@ -23,6 +25,8 @@ nnoremap <leader>fh <cmd>Telescope help_tags<cr>
2325
nnoremap <leader>da :Lexplore %:p:h<CR>
2426
nnoremap <Leader>dd :Explore<CR>
2527
28+
colorscheme gruvbox
29+
2630
lua << EOF
2731
require('telescope').setup{
2832
pickers = {
@@ -32,6 +36,53 @@ pickers = {
3236
}
3337
}
3438
}
39+
40+
require'nvim-treesitter.configs'.setup{
41+
-- A list of parser names, or "all" (the listed parsers MUST always be installed)
42+
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "markdown", "markdown_inline", "javascript", "bash" },
43+
44+
-- Install parsers synchronously (only applied to `ensure_installed`)
45+
sync_install = false,
46+
47+
-- Automatically install missing parsers when entering buffer
48+
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
49+
auto_install = true,
50+
51+
-- List of parsers to ignore installing (or "all")
52+
-- ignore_install = { "javascript" },
53+
54+
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
55+
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
56+
57+
highlight = {
58+
enable = true,
59+
60+
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
61+
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
62+
-- the name of the parser)
63+
-- list of language that will be disabled
64+
disable = { "c", "rust" },
65+
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
66+
disable = function(lang, buf)
67+
local max_filesize = 100 * 1024 -- 100 KB
68+
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
69+
if ok and stats and stats.size > max_filesize then
70+
return true
71+
end
72+
end,
73+
74+
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
75+
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
76+
-- Using this option may slow down your editor, and you may see some duplicate highlights.
77+
-- Instead of true it can also be a list of languages
78+
additional_vim_regex_highlighting = false,
79+
},
80+
}
3581
EOF
3682

37-
colorscheme gruvbox
83+
" https://github.com/dense-analysis/ale/blob/master/supported-tools.md
84+
let g:ale_linters = {
85+
\ 'json': ['prettier']
86+
\}
87+
" Only run linters named in ale_linters settings.
88+
let g:ale_linters_explicit = 1

help/vim.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Vim & Neovim
2+
3+
## Getting started
4+
5+
1. Copy init.vim
6+
2. Install Vim plug
7+
3. Install plugins
8+
```
9+
PlugInstall
10+
```
11+
12+
## Commands
13+
114
### delete in netrw
215
```
316
Shift + D

0 commit comments

Comments
 (0)