updated neovim state
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2025-03-09 19:14:04 +01:00
parent 07089cff18
commit a283b27766
2 changed files with 24 additions and 28 deletions

View File

@ -9,8 +9,8 @@ vim.cmd.syntax('on')
{%- endif %}
{% macro cfg(command, settings) -%}
{% if command == "globals" %}{% set t = "g" %}{% endif %}
{% if command == "options" %}{% set t = "o" %}{% endif %}
{%- if command == "globals" %}{% set t = "g" %}{% endif %}
{%- if command == "options" %}{% set t = "o" %}{% endif %}
{% for k, v in settings.items() %}
vim.{{ t }}["{{ k }}"]{% if v is defined %}={% if v is integer or v is boolean %}{{ v }}{% else %}"{{ v }}"{% endif %}{% endif %}
{%- endfor %}
@ -22,7 +22,27 @@ vim.{{ t }}["{{ k }}"]{% if v is defined %}={% if v is integer or v is boolean %
-- NeoVIM options
{{- cfg("options", neovim.config.options) }}
{% if "nvim-tree" in neovim.plugins.keys() %}
function RemoveComments()
vim.cmd.normal("g/^#/d")
vim.cmd.normal("g/^$/d")
end
function Reformat()
vim.cmd.normal('gg=G')
end
vim.api.nvim_command("command! Reformat call luaeval('Reformat()')")
vim.api.nvim_command("command! RemoveComments call luaeval('RemoveComments()')")
vim.keymap.set("n", "<F9>", ":!%:p")
vim.keymap.set("n", "<C-s>", ":FzfLua<CR>")
vim.keymap.set("v", "<C-a>", "g<C-a>")
vim.keymap.set("v", "<C-x>", "g<C-x>")
vim.keymap.set("v", "g<C-a>", "<C-a>")
vim.keymap.set("v", "g<C-x>", "<C-x>")
{% if "nvim-tree" in neovim.plugins.keys() -%}
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
@ -42,4 +62,4 @@ require("nvim-tree").setup({
dotfiles = true,
},
})
{% endif %}
{% endif -%}

View File

@ -5,25 +5,6 @@ if filereadable("/etc/xdg/nvim/init.lua")
luafile /etc/xdg/nvim/init.lua
endif
function! RemoveComments()
"silent %s/\t/ /g
"silent %s/ *#.*//g
silent g/^#/d
silent g/^$/d
"silent sort
endfunction
function! Reformat()
:normal gg=G
endfunction
command! Reformat call Reformat()
command! RemoveComments call RemoveComments()
nnoremap <F9> :!%:p
nnoremap <C-s> :FzfLua<CR>
if has("autocmd")
au VimEnter,InsertLeave * silent execute '!echo -ne "\e[2 q"' | redraw!
au InsertEnter,InsertChange *
@ -46,8 +27,3 @@ if exists("*NERDTreeToggle")
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
nnoremap <silent> <C-b> :NERDTreeToggle<CR>
endif
vnoremap <C-a> g<C-a>
vnoremap <C-x> g<C-x>
vnoremap g<C-a> <C-a>
vnoremap g<C-x> <C-x>