Giter Club home page Giter Club logo

nosyntaxwords's Introduction

This is a mirror of http://www.vim.org/scripts/script.php?script_id=4060

This plugin provides commands to find words that are not syntactically highlighted in current buffer. I mostly used them to debug vim syntax engine / ctags / plugin TagHighlight etc.

Commands:

:NextNoSyntaxWord - find next word that is not syntactically highlighted.
:GetNoSyntaxWords - get list of words that are not syntactically highlighted and show it.

The list is stored in buffer variable b:nosyntaxwords and it can be shown again by issuing command

:echo b:nosyntaxwords

Due to difference between algorithms 'normal w' and 'expand("<cword>")' that are used in implementation of the plugin, global variable g:NswSkipSymbols was involved. This variable is a dictionary that contains lists of special symbols for specified filetypes that are supposed to be not syntactically highlighted for this filetype and must be skipped when using 'normal w', otherwise they will be included in the list or, even worse (if they do not belong to 'iskeyword' list), following them words will be included in the list.
                                                                           
By default g:NswSkipSymbols has support for filetypes 'c', 'cpp', 'python', 'perl', 'vim' and 'tagbar', but if needed this can be extended for using with other filetypes, default symbols for a supported filetype can be changed as well. For example, to add support for filetype 'ruby' put in your .vimrc lines

let g:NswSkipSymbols = {}
let g:NswSkipSymbols['ruby'] = ['(', ')']       " whatever else

To use this plugin efficiently i recommend to use following mappings:

nmap <silent> ,vv  :echo synIDattr(synID(line("."), col("."), 1), "name")<CR>
nmap <silent> ,vn  :NextNoSyntaxWord<CR>
nmap <silent> ,vl  :GetNoSyntaxWords<CR>

(mapping ,vv is for showing syntax class of word under cursor and does not refer directly to this plugin).

nosyntaxwords's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.