Coder Social home page Coder Social logo

salt-vim's Issues

Dog-slow in sls with long lines

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.

UTF-8 warning for salt problems

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 ?

small parser bug/ feature request when using multiple loops with { } ?

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

wrong autoindent on copy/paste

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

add filetype plugin on to docs

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.

Complete states

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

mako python code upsets syntax coloring

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:

screen shot 2016-11-09 at 09 nov 12 33 10

This is mako code that generates jinja templates, hence the amount of braces.

Evil Mode

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.

License?

I'd like to make a code-related pull request, but I can't find a license in the repository.

auto-indentation broken

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.

vim reports "Invalid expression" in syntax/sls.vim

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?

salt-vim with Syntastic?

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?

question: disable folding? Overriding sls.vim's "foldmethod=indent"

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.

nicer install / update resistant:

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

How to make a string in single quotes is highlighted as blue?

I would like to use single quotes for pillar.get or concatenate strings:

jinja2 string in vim

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

Sublime Text Support

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 :)

Fold/unfold all?

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.