vim: highlight markdown-style code fences
e.g. ```tex did you know $\frac29 == \frac4{18}$ ? ```
This commit is contained in:
52
modules/universal/env/home-manager.nix
vendored
52
modules/universal/env/home-manager.nix
vendored
@@ -262,7 +262,7 @@ in
|
|||||||
# pol[itical] gets used for social commentary and economics as well.
|
# pol[itical] gets used for social commentary and economics as well.
|
||||||
# visual gets used for comics/art
|
# visual gets used for comics/art
|
||||||
"uncat" "rat" "tech" "pol" "visual"
|
"uncat" "rat" "tech" "pol" "visual"
|
||||||
];
|
];
|
||||||
open_youtube_externally = false;
|
open_youtube_externally = false;
|
||||||
media_player = "vlc"; # default: mpv
|
media_player = "vlc"; # default: mpv
|
||||||
};
|
};
|
||||||
@@ -381,11 +381,19 @@ in
|
|||||||
viAlias = true;
|
viAlias = true;
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
# docs: surround-nvim: https://github.com/ur4ltz/surround.nvim/
|
# docs: surround-nvim: https://github.com/ur4ltz/surround.nvim/
|
||||||
# docs: vim-surround: https://github.com/tpope/vim-surround
|
# docs: vim-surround: https://github.com/tpope/vim-surround
|
||||||
vim-surround
|
vim-surround
|
||||||
# docs: fzf-vim (fuzzy finder): https://github.com/junegunn/fzf.vim
|
# docs: fzf-vim (fuzzy finder): https://github.com/junegunn/fzf.vim
|
||||||
fzf-vim
|
fzf-vim
|
||||||
|
({
|
||||||
|
plugin = vim-SyntaxRange;
|
||||||
|
type = "viml";
|
||||||
|
config = ''
|
||||||
|
" enable markdown-style codeblock highlighting for tex code
|
||||||
|
autocmd BufEnter * call SyntaxRange#Include('```tex', '```', 'tex', 'NonText')
|
||||||
|
'';
|
||||||
|
})
|
||||||
# nabla renders inline math in any document, but it's buggy.
|
# nabla renders inline math in any document, but it's buggy.
|
||||||
# https://github.com/jbyuki/nabla.nvim
|
# https://github.com/jbyuki/nabla.nvim
|
||||||
# ({
|
# ({
|
||||||
@@ -396,16 +404,22 @@ in
|
|||||||
# '';
|
# '';
|
||||||
# })
|
# })
|
||||||
# treesitter syntax highlighting: https://nixos.wiki/wiki/Tree_sitters
|
# treesitter syntax highlighting: https://nixos.wiki/wiki/Tree_sitters
|
||||||
# config taken from: https://github.com/i077/system/blob/master/modules/home/neovim/default.nix
|
# docs: https://github.com/nvim-treesitter/nvim-treesitter
|
||||||
# this is required for tree-sitter to even highlight
|
# config taken from: https://github.com/i077/system/blob/master/modules/home/neovim/default.nix
|
||||||
({
|
# this is required for tree-sitter to even highlight
|
||||||
plugin = (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars));
|
({
|
||||||
type = "lua";
|
plugin = (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars));
|
||||||
config = ''
|
type = "lua";
|
||||||
|
config = ''
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
disable = {}
|
-- disable treesitter on Rust so that we can use SyntaxRange
|
||||||
|
-- and leverage TeX rendering in rust projects
|
||||||
|
disable = { "rust", "tex", "latex" },
|
||||||
|
-- disable = { "tex", "latex" },
|
||||||
|
-- true to also use builtin vim syntax highlighting when treesitter fails
|
||||||
|
additional_vim_regex_highlighting = false
|
||||||
},
|
},
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
@@ -421,26 +435,26 @@ in
|
|||||||
disable = {}
|
disable = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.o.foldmethod = 'expr'
|
vim.o.foldmethod = 'expr'
|
||||||
vim.o.foldexpr = 'nvim_treesitter#foldexpr()'
|
vim.o.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
" copy/paste to system clipboard
|
" copy/paste to system clipboard
|
||||||
set clipboard=unnamedplus
|
set clipboard=unnamedplus
|
||||||
|
|
||||||
" at least don't open files with sections folded by default
|
" at least don't open files with sections folded by default
|
||||||
set nofoldenable
|
set nofoldenable
|
||||||
|
|
||||||
" horizontal rule under the active line
|
" horizontal rule under the active line
|
||||||
" set cursorline
|
" set cursorline
|
||||||
|
|
||||||
" highlight trailing space & related syntax errors (doesn't seem to work??)
|
" highlight trailing space & related syntax errors (doesn't seem to work??)
|
||||||
" let c_space_errors=1
|
" let c_space_errors=1
|
||||||
" let python_space_errors=1
|
" let python_space_errors=1
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# XXX: although home-manager calls this option `firefox`, we can use other browsers and it still mostly works.
|
# XXX: although home-manager calls this option `firefox`, we can use other browsers and it still mostly works.
|
||||||
|
Reference in New Issue
Block a user