vmware-archive / salt-vim Goto Github PK
View Code? Open in Web Editor NEWVim files for editing Salt files
License: Other
Vim files for editing Salt files
License: Other
When there are long lines in the sls, whole vim becomes very unresponsive and slow. I have an sls where multiple ssh public keys are listed and the only way I can edit that is by setting set ft=none
.
Hello,
The function is very nice.
But would'nt it be better to set then the default behavior that vim didn't save them in the wrong format?
like here:
http://automatthias.wordpress.com/2006/07/18/vim-utf-8-and-iso-8859-2/
I have added in ~/.vim/ftplugin/sls.vim:
setlocal fileencoding=latin1
and now it looks nice in the file:
# file telescope/init.sls
telescope/init.sls: ASCII text, with very long lines
# vi telescope/init.sls
< adding umlauts äöüß>
# file telescope/init.sls
telescope/init.sls: ISO-8859 text, with very long lines
There is only still the red warning in the interface because editing is done in UTF-8 locale which can then be removed ?
On some files, vim goes extremely slow, often pausing for many seconds while moving around. Here's one such file to reproduce that with: https://gist.github.com/gthb/b91d37f8558e4e067ee9
Hello,
I got a file with a nice onliner for setting variables from pillar to enhance like:
{%- do environments[environment].update ({ 'jenkins': { 'port': '1' + port['environment'][environment]['port'] + '00' + '6' }}) %}
and the closing loops written as }}
are marked red because the parser identifies it as closing saltstack tag which is missing the opening tag instead of 2 independent ending loop marker.
If this is not too complicated it would be nice there could a fix ?
Bests
By default, filetype
is off for *.jinja2
. To make the UltiSnips work, I have to turn on the filetype:
:se ft=jinja2
but syntax highlighting disappeared after that.
How can I turn on the filetype for jjinja2 without losing the syntax highlighting?
When copying and pasting an already indented block, like:
mysql:
__service:
__- running
it will add extra tabs and will look like this:
mysql:
____service:
________- running
Would be useful to add ":filetype plugin on" intruction to docs.
Would save some time for novice vim users :D.
Other than that, great project! Thanks.
It would be nice to complete state names and arguments.
I propose to add variable:
set salt_minion=localhost
And then gather completions with:
salt $salt_minion sys.state_argspec
I realize you maybe not want to support mako in slses but if you still want to here is a short snippet of code that upsets the syntax coloring:
<%
out.append("{{{{ record('{0}', 'SSHFP', '{1}') }}}}".format(host,line))
# the following line starts red
out.append("{{{{ record('piro', 'SSHFP', '{0}') }}}}".format(line))
%>
${"\n".join(out)}
Looks like this:
This is mako code that generates jinja templates, hence the amount of braces.
Please mention evil-mode compatibility in the readme?
I'm an eviller, myself. I just love lisp too much.
In every other respect's vim's superior, and evil suits.
I'd like to make a code-related pull request, but I can't find a license in the repository.
when indenting using gg=G, the indentation does what its documented to do.
Every ':' the new line gets indented two more spaces. the problem is it never goes back.
base:
'host1':
- services.apache
'host2':
- services.apache
..it just never removes the two spaces again when it should.
I'm using vim-8.2.2607.
When editing a sls file, vim complains about the following "Invalid expression" on startup:
# vi whatever.sls
Error detected while processing /etc/vimrc[42]../usr/share/vim/vim82/syntax/syntax.vim[42]..BufRead Autocommands for "*.sls"..function DetectSls[5]..FileType Autocommands for "*"..Syntax Autocommands for "*"..function <SNR>3_SynSet[25]..script /home/cb/.vim/syntax/sls.vim:
line 67:
E15: Invalid expression: {
line 68:
E10: \ should be followed by /, ? or &
line 69:
E10: \ should be followed by /, ? or &
Press ENTER or type command to continue
Can you please fix this?
The git clone address [email protected]:saltstack/salt-vim.git
should be http://github.com/saltstack/salt-vim.git
, so non-members can still install the package.
Is there support to enable syntastic checking for SLS files? I haven't been able to find a compatible linter for it. js-yaml is close, but it obviously chokes on Jinja.
Has anyone been able to get this working?
Having a difficult time overriding the folding set by PR #1:
" folding
setlocal foldmethod=indent
setlocal foldlevel=6 " by default do not fold
I use a very vanilla vim, but folding occurs, appears as:
verify-docker-tcp-server:
cmd.run:
# although docker service is 'started', we must await a few seconds until tcp port is bound
- name: |
timeout 10 bash -c '\
until curl --verbose --fail --show-error --silent \
+-------- 4 lines: https://localhost:2376/images/json \----------------------------------------------
do
sleep 1
done'
If I try to disable this by .vimrc:
set foldmethod=manual
These settings are not honored when opening any .sls
file, they remain as set in sls.vim
, when i type ":set foldmethod" on any non-.sls
file, foldmethod=manual
, but opening a .sls
sets foldmethod=indent
again.
Currently there are links to the readme docs for Pathogen and Vundle, but the steps aren't there. No reason to create a few extra clicks/confusion for people who might just be getting started, let's just put the command right in the readme.
It would be a little more useful if e.g. after:
cd ~/.vim/
git clone https://github.com/saltstack/salt-vim.git
symlinks are created for config files instead of copies:
cd salt-vim
ls */* | xargs -I{} ln -s ../salt-vim/{} ../{}
Or manual way:
ln -s ../salt-vim/ftdetect/sls.vim ~/.vim/ftdetect/sls.vim
ln -s ../salt-vim/ftplugin/sls.vim ~/.vim/ftplugin/sls.vim
ln -s ../salt-vim/syntax/sls.vim ~/.vim/syntax/sls.vim
Bests
I would like to use single quotes for pillar.get or concatenate strings:
but also want to highlight the string as blue like in the second line.
How to do that?
My ~/.vimrc
:
set backup
let day = strftime("%Y-%m-%d")
let user = substitute(system('whoami'), '\n', '', '')
if user == 'root'
let backupdir = "/var/root/.vim/backup/".day
else
let backupdir = $HOME."/.vim/backup/".day
endif
silent! let xyz = mkdir(backupdir, "p")
let cmd = "set backupdir=".backupdir
execute cmd
let time = strftime(".%H:%M:%S")
let cmd = "set backupext=".time
execute cmd
syntax on
set number
set background=dark
let g:solarized_termcolors = 256
let g:solarized_visibility = "high"
let g:solarized_contrast = "high"
let g:solarized_termtrans = 1
colorscheme solarized
autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab
"autocmd FileType rst set syntax=rest
set clipboard=unnamed
execute pathogen#infect()
let g:SuperTabDefaultCompletionType = "context"
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
" powerline
" end of powerline
set nocompatible
filetype plugin indent on
autocmd BufRead,BufNewFile *.jinja2 set filetype=sls.jinja2
nnoremap <F6> :GundoToggle<CR>
" ultisnips
let g:UltiSnipsSnippetsDir ="~/.vim/bundle/ultisnips/UltiSnips"
let g:UltiSnipsListSnippets = "<c-j>"
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
" end of ultisnips
au BufNewFile *.jinja2 so ~/.vim/header/jinja_header.txt
au BufNewFile *.py so ~/.vim/header/py_header.txt
au BufNewFile *.sls so ~/.vim/header/sls_header.txt
let mapleader = ","
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_map = '<leader>f'
let g:ctrlp_prompt_mappings = {
\ 'AcceptSelection("e")': ['<c-v>', '<2-LeftMouse>'],
\ 'AcceptSelection("v")': ['<cr>', '<RightMouse>'],
\ }
" airline
set laststatus=2
" end of airline
" highlight excess line length (79)
autocmd Filetype py rst textwidth=79
set colorcolumn=+1
" go
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
" end of go
" neocomplete
" let g:neocomplete#enable_at_startup = 1
" end of neocomplete
" disable folding
set nofoldenable
" end of disable folding
" disable matchparen
" let loaded_matchparen=1
" end of disable matchparen
Vim is good. But sometimes I just need to use something else rather than spent an hour learning more vim-fu.
Different syntax highlighting between editors is very annoying.
I'll eventually find time to write this myself if no one else cares... but I know someone smarter than me in both Sublime Text knowledge and Salt knowledge would be able to do it a lot sooner, like months sooner :)
Is it possible to toggle fold/unfold all sections of a state file with one command? Scrolling to each fold and pressing 'space' on many folds is time consuming. TIA!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.