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

This commit is contained in:
Paul 2025-03-09 18:23:51 +01:00
parent 4097b6a60c
commit 3c1de64b0b
5 changed files with 83 additions and 103 deletions

View File

@ -1,91 +1,44 @@
---
neovim:
enabled: true
enable: true
neovimfiles_dir: /etc/xdg/nvim
colors_dir: /etc/xdg/nvim/colors
plugins_dir: /usr/share/nvim/site/pack/plugins/start
config:
options: {}
use_theme: monokai
lets:
defaults_neovim:
name: g:skip_defaults_vim
value: 1
rustfmt_autosave:
name: g:rustfmt_autosave
value: 1
ale_completion_enabled:
name: g:ale_completion_enabled
value: 0
jedi#popup_on_dot:
name: g:jedi#popup_on_dot
value: 0
sets:
fileencoding:
name: fileencoding
value: utf-8
fileencodings:
name: fileencodings
value: utf-8,latin1
encoding:
name: encoding
value: utf-8
globals:
skip_defaults_vim: 1
rustfmt_autosave: 1
ale_completion_enabled: 0
jedi#popup_on_dot: 0
options:
fileencoding: utf-8
fileencodings: "utf-8,latin1"
encoding: utf-8
eol:
name: eol
nocompatible:
name: nocompatible
nofixeol:
name: nofixeol
noignorecase:
name: noignorecase
mouse:
name: mouse=
number:
name: number
viminfo:
name: viminfo
value: "'50,<1000,s100,h"
timeoutlen:
name: timeoutlen
value: 1000
backspace:
name: backspace
value: indent,eol,start
viminfo: "'50,<1000,s100,h"
timeoutlen: 1000
backspace: "indent,eol,start"
autoindent:
name: autoindent
nocindent:
name: nocindent
ic:
name: ic
modeline:
name: modeline
incsearch:
name: incsearch
tabstop:
name: tabstop
value: 2
shiftwidth:
name: shiftwidth
value: 2
softtabstop:
name: softtabstop
value: 2
tabstop: 2
shiftwidth: 2
softtabstop: 2
expandtab:
name: expandtab
#pastetoggle:
# name: pastetoggle
# value: "<F9>"
laststatus:
name: laststatus
value: 2
t_Co:
name: t_Co
value: 256
t_ut:
name: t_ut
value: ""
laststatus: 2
t_Co: 256
t_ut: ""
use_syntax: true
themes:
monokai:
url: https://raw.githubusercontent.com/sickill/vim-monokai/master/colors/monokai.vim
plugins: {}
monokai: https://raw.githubusercontent.com/sickill/vim-monokai/master/colors/monokai.vim
plugins:
lightline: https://github.com/itchyny/lightline.vim.git
nvim-tree: https://github.com/nvim-tree/nvim-tree.lua.git

View File

@ -13,11 +13,12 @@ neovim-plugin-dirs:
- makedirs: true
{%- for name, value in neovim.plugins.items() %}
{% set vals = value.split("@") }
neovim-plugin-{{ name }}:
git.latest:
- name: {{ value.url }}
- name: {{ vals[0] }}
- target: {{ neovim.plugins_dir }}/{{ name }}
- rev: {{ value.rev|default('HEAD') }}
- rev: {{ vals[1]|default('HEAD') }}
- force_reset: true
- submodules: true
- parallel: true

View File

@ -0,0 +1,46 @@
--{{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
{%- from "neovim/map.jinja" import neovim with context %}
-- NeoVIM global configs
vim.cmd.colorscheme('{{ neovim.config.use_theme }}')
vim.cmd.filetype('plugin on')
{%- if neovim.config.use_syntax %}
vim.cmd.syntax('on')
{%- endif %}
{% macro cfg(command, settings) -%}
{% set t = 'g' if command = "globals" %}
{% set t = 'o' if command = "options" %}
{% for k, v in settings.items() %}
vim.{{ t }}["{{ v.name }}"]{% if v.value is defined %}={% if v.value.integer() or v.value.boolean() %}{{ v.value }}{% else %}"{{ v.value }}"{% endif %}
{%- endfor %}
{% endmacro -%}
-- NeoVIM globals
{{- cfg("globals", neovim.config.globals) }}
-- NeoVIM options
{{- cfg("options", neovim.config.options) }}
{% if "nvim-tree" in neovim.plugins.keys %}
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
vim.opt.termguicolors = true
require("nvim-tree").setup({
sort = {
sorter = "case_sensitive",
},
view = {
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})
{% endif %}

View File

@ -1,28 +1,10 @@
"{{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
{%- from "neovim/map.jinja" import neovim with context %}
" NeoVIM global configs
colorscheme {{ neovim.config.use_theme }}
filetype plugin on
{%- if neovim.config.use_syntax %}
syntax on
{%- endif %}
if filereadable("/etc/xdg/nvim/init.lua")
luafile /etc/xdg/nvim/init.lua
endif
{% macro cfg(command, setting) -%}
{% for key, value in setting.items() %}
{{ command }} {{ value.name }}{% if value.value is defined %}={{ value.value }}{% endif %}
{%- endfor %}
{% endmacro -%}
" NeoVIM lets
{{- cfg("let", neovim.config.lets) }}
" NeoVIM sets
{{- cfg("set", neovim.config.sets) }}
function! RemoveComments()
"silent %s/\t/ /g
@ -54,18 +36,16 @@ if has("autocmd")
endif
" NERDTree
set wildignore+=*.pyc,*.o,*.obj,*.svn,*.swp,*.class,*.hg,*.DS_Store,*.min.*
let g:NERDTreeShowHidden = 1
let g:NERDTreeMinimalUI = 1
let g:NERDTreeIgnore = []
let g:NERDTreeStatusline = ''
let g:NERDTreeRespectWildIgnore=1
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
nnoremap <silent> <C-b> :NERDTreeToggle<CR>
" Support for end-of-lines
" au BufWritePre * :set binary | set noeol
" au BufWritePost * :set nobinary | set eol
if exists("*NERDTreeToggle")
set wildignore+=*.pyc,*.o,*.obj,*.svn,*.swp,*.class,*.hg,*.DS_Store,*.min.*
let g:NERDTreeShowHidden = 1
let g:NERDTreeMinimalUI = 1
let g:NERDTreeIgnore = []
let g:NERDTreeStatusline = ''
let g:NERDTreeRespectWildIgnore=1
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>

View File

@ -4,7 +4,7 @@
neovim-{{ name }}-theme:
file.managed:
- name: {{ neovim.colors_dir }}/{{ name }}.vim
- source: {{ value.url }}
- source: {{ value }}
- skip_verify: true
- user: root
- group: root