Update neovim config again
diff --git a/modules/neovim/astro/astro.vim b/modules/neovim/astro/astro.vim
new file mode 100644
index 0000000..b6314ad
--- /dev/null
+++ b/modules/neovim/astro/astro.vim
@@ -0,0 +1,16 @@
+let g:astro_typescript = 'enable'
+
+let g:closetag_filetypes = 'html,xhtml,phtml,astro'
+let g:closetag_xhtml_filetypes = 'xhtml,jsx'
+
+let g:closetag_emptyTags_caseSensitive = 1
+
+let g:closetag_regions = {
+ \ 'typescript.tsx': 'jsxRegion,tsxRegion',
+ \ 'javascript.jsx': 'jsxRegion',
+ \ 'typescriptreact': 'jsxRegion,tsxRegion',
+ \ 'javascriptreact': 'jsxRegion',
+ \ }
+
+let g:closetag_shortcut = '>'
+ let g:closetag_close_shortcut = '<leader>>'
diff --git a/modules/neovim/astro/default.nix b/modules/neovim/astro/default.nix
new file mode 100644
index 0000000..0fc72e9
--- /dev/null
+++ b/modules/neovim/astro/default.nix
@@ -0,0 +1,14 @@
+{ pkgs
+, nixpkgs-minion
+, system
+, ...
+}: {
+ programs.neovim = {
+ plugins = [
+ nixpkgs-minion.legacyPackages.${system}.vimPlugins.vim-astro
+ pkgs.vimPlugins.vim-closetag
+ ];
+
+ extraConfig = builtins.readFile ./astro.vim;
+ };
+}
diff --git a/modules/neovim/binds/binds.vim b/modules/neovim/binds/binds.vim
index 99281c9..35353a8 100644
--- a/modules/neovim/binds/binds.vim
+++ b/modules/neovim/binds/binds.vim
@@ -1,7 +1,9 @@
set whichwrap=b,s,<,>,[,]
-" set mouse=a
+set mouse=
-nmap <C-k> :m-2<CR>
+vmap <C-k> :m-2<CR>
+vmap <C-j> :m+1<CR>
+nmap <C-k> :m-2<CR>
nmap <C-j> :m+1<CR>
vmap <F12> <Esc>
@@ -24,9 +26,9 @@
autocmd!
autocmd BufWritePre * call s:auto_mkdir(expand('<afile>:p:h'), v:cmdbang)
function! s:auto_mkdir(dir, force)
- if !isdirectory(a:dir)
+ if !isdirectory(a:dir) && !(a:dir =~ "^suda:///.*$")
\ && (a:force
- \ || input("'" . a:dir . "' does not exist. Create? [y/N]") =~? '^y\%[es]$')
+ \ || input("'" . a:dir . "' does not exist. Create? [y/N]: ") =~? '^y\%[es]$')
call mkdir(iconv(a:dir, &encoding, &termencoding), 'p')
endif
endfunction
@@ -63,3 +65,5 @@
autocmd BufWinEnter ?* silent! loadview
tnoremap <Esc><Esc> <C-\><C-n>
+
+let g:camelcasemotion_key = '<leader>m'
diff --git a/modules/neovim/binds/default.nix b/modules/neovim/binds/default.nix
index ec657a6..e7a2c53 100644
--- a/modules/neovim/binds/default.nix
+++ b/modules/neovim/binds/default.nix
@@ -1,6 +1,6 @@
{ pkgs, ... }: {
programs.neovim = {
- plugins = [ pkgs.vimPlugins.FixCursorHold-nvim ];
+ plugins = with pkgs.vimPlugins; [ FixCursorHold-nvim camelcasemotion ];
extraConfig = builtins.readFile ./binds.vim;
};
}
diff --git a/modules/neovim/brackets/pear-tree.vim b/modules/neovim/brackets/pear-tree.vim
index 43dfbf3..e4b4143 100644
--- a/modules/neovim/brackets/pear-tree.vim
+++ b/modules/neovim/brackets/pear-tree.vim
@@ -15,3 +15,4 @@
imap <BS> <Plug>(PearTreeBackspace)
imap <Esc> <Plug>(PearTreeFinishExpansion)
+
diff --git a/modules/neovim/coc/keybinds.vim b/modules/neovim/coc/keybinds.vim
index a0a4371..d4b583c 100644
--- a/modules/neovim/coc/keybinds.vim
+++ b/modules/neovim/coc/keybinds.vim
@@ -34,7 +34,7 @@
inoremap <silent><expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(0) :
\ coc#jumpable() ? "\<Esc>:call coc#snippet#prev()\<CR>" :
\ tablemode#table#IsTable('.') ? "\<Esc>:call tablemode#spreadsheet#cell#Motion('h')\<CR>" . mode() :
- \ "\<S-Tab>"
+ \ "\<Plug>(PearTreeJump)"
xnoremap <silent> <Tab> <Plug>(coc-snippets-select)
nnoremap <silent><expr> <CR> coc#jumpable() ?
diff --git a/modules/neovim/git/binds.vim b/modules/neovim/git/binds.vim
index 50c4821..4d4ad8c 100644
--- a/modules/neovim/git/binds.vim
+++ b/modules/neovim/git/binds.vim
@@ -1,6 +1,5 @@
let mapleader = ","
set whichwrap=b,s,<,>,[,]
-set mouse=a
vnoremap // y/\V<C-R>=escape(@",'/\')<CR><CR>
diff --git a/modules/neovim/hardtime/hardtime.vim b/modules/neovim/hardtime/hardtime.vim
index 29fcc48..9c140bb 100644
--- a/modules/neovim/hardtime/hardtime.vim
+++ b/modules/neovim/hardtime/hardtime.vim
@@ -1,5 +1,5 @@
let g:hardtime_default_on = 1
-let g:list_of_disabled_keys = ["<UP>", "<DOWN>", "<LEFT>", "<RIGHT>", "<C-UP>", "<C-DOWN>", "<C-LEFT>", "<C-RIGHT>"]
+let g:list_of_disabled_keys = ["<UP>", "<DOWN>", "<LEFT>", "<RIGHT>", "<C-LEFT>", "<C-RIGHT>"]
let g:hardtime_showmsg = 1
let g:hardtime_allow_different_key = 1
diff --git a/modules/neovim/multi-cursor/default.nix b/modules/neovim/multi-cursor/default.nix
new file mode 100644
index 0000000..3c61689
--- /dev/null
+++ b/modules/neovim/multi-cursor/default.nix
@@ -0,0 +1,6 @@
+{pkgs, ...}: {
+ programs.neovim = {
+ plugins = [pkgs.vimPlugins.vim-visual-multi];
+ extraConfig = builtins.readFile ./theme.vim;
+ };
+}
diff --git a/modules/neovim/multi-cursor/theme.vim b/modules/neovim/multi-cursor/theme.vim
new file mode 100644
index 0000000..e345701
--- /dev/null
+++ b/modules/neovim/multi-cursor/theme.vim
@@ -0,0 +1,8 @@
+let g:VM_theme_set_by_colorscheme = 1
+
+call g:Highlight("VM_Extend", g:transparent, g:lightgrey)
+call g:Highlight("VM_Cursor", g:black, g:white)
+call g:Highlight("VM_Insert", g:black, g:white)
+call g:Highlight("VM_Mono", g:black, g:cyan)
+
+let g:VM_leader = "\\"
diff --git a/modules/neovim/presence/default.nix b/modules/neovim/presence/default.nix
new file mode 100644
index 0000000..ec874a4
--- /dev/null
+++ b/modules/neovim/presence/default.nix
@@ -0,0 +1,7 @@
+{pkgs, ...}: {
+ programs.neovim = {
+ plugins = [pkgs.vimPlugins.presence-nvim];
+
+ extraConfig = builtins.readFile ./presence.vim;
+ };
+}
diff --git a/modules/neovim/presence/presence.vim b/modules/neovim/presence/presence.vim
new file mode 100644
index 0000000..7f851dc
--- /dev/null
+++ b/modules/neovim/presence/presence.vim
@@ -0,0 +1,20 @@
+" General options
+let g:presence_auto_update = 1
+let g:presence_neovim_image_text = "Neovim"
+let g:presence_main_image = "neovim"
+let g:presence_client_id = "793271441293967371"
+let g:presence_debounce_timeout = 10
+let g:presence_enable_line_number = 0
+let g:presence_blacklist = []
+let g:presence_buttons = 1
+let g:presence_file_assets = {}
+let g:presence_show_time = 1
+
+" Rich Presence text options
+let g:presence_editing_text = "Editing %s"
+let g:presence_file_explorer_text = "Browsing %s"
+let g:presence_git_commit_text = "Committing changes"
+let g:presence_plugin_manager_text = "Managing plugins"
+let g:presence_reading_text = "Reading %s"
+let g:presence_workspace_text = "Working on %s"
+let g:presence_line_number_text = "Line %s out of %s"
diff --git a/modules/neovim/suda/default.nix b/modules/neovim/suda/default.nix
new file mode 100644
index 0000000..083203b
--- /dev/null
+++ b/modules/neovim/suda/default.nix
@@ -0,0 +1,7 @@
+{pkgs, ...}: {
+ programs.neovim = {
+ plugins = [pkgs.vimPlugins.suda-vim];
+
+ extraConfig = builtins.readFile ./suda.vim;
+ };
+}
diff --git a/modules/neovim/suda/suda.vim b/modules/neovim/suda/suda.vim
new file mode 100644
index 0000000..03ad354
--- /dev/null
+++ b/modules/neovim/suda/suda.vim
@@ -0,0 +1,3 @@
+let g:suda_smart_edit = 1
+
+
diff --git a/modules/neovim/surround/default.nix b/modules/neovim/surround/default.nix
new file mode 100644
index 0000000..2149cdc
--- /dev/null
+++ b/modules/neovim/surround/default.nix
@@ -0,0 +1,7 @@
+{pkgs, ...}: {
+ programs.neovim = {
+ plugins = [pkgs.vimPlugins.nvim-surround];
+
+ extraConfig = "source ${./surround.lua}";
+ };
+}
diff --git a/modules/neovim/surround/surround.lua b/modules/neovim/surround/surround.lua
new file mode 100644
index 0000000..f2499fd
--- /dev/null
+++ b/modules/neovim/surround/surround.lua
@@ -0,0 +1 @@
+require("nvim-surround").setup({})
diff --git a/modules/neovim/tree-sitter/default.nix b/modules/neovim/tree-sitter/default.nix
index 24ae162..caf1995 100644
--- a/modules/neovim/tree-sitter/default.nix
+++ b/modules/neovim/tree-sitter/default.nix
@@ -1,5 +1,7 @@
{ pkgs
, lib
+, nixpkgs-minion
+, system
, ...
}:
let
@@ -17,6 +19,7 @@
])
++ (with pkgs.vimPlugins; [
nvim-ts-rainbow
+ nixpkgs-minion.legacyPackages.${system}.tree-sitter-grammars.tree-sitter-astro
])))
nvim-treesitter-context
];