Giter Club home page Giter Club logo

showblockname.vim's Introduction

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

Display the name of the current "block" the cursor is in in the command-line
area (i.e., with vim's echo).

A "block" is context-sensitive, (e.g., function name, variable name if in an
initialization, type name if in a typedef, etc.)

NOTE: The only languages with specific support as-is are vim scripts, Perl, and C.  Support for other languages can be added by modifying the script with appropriate search patterns.

Typical use (.vimrc):
  au CursorHold *	call ShowBlockName('quiet')

  " Show the name of the function we're in on the message line; pnuemonic [[
  map <silent> g[[	:call ShowBlockName()<CR>

  " Disable ShowBlockName (once); to prevent the CursorHold autocommand from
  " overwriting something in the command window (e.g., SyntaxAttr() output).
  map <silent> g]] :call ShowBlockName('OFF')<CR>


  " Tweak commands like [d so that they disable ShowBlockName so
  " it doesn't obliterate the output of this command.
  nnoremap [d :call ShowBlockName('[d')<CR>
  nnoremap [i :call ShowBlockName('[i')<CR>

NOTE:
	This will NOT work if the start-of-block is the first line in a file.

THIS SCRIPT USES ShowLine ( vimscript #381 )

showblockname.vim's People

Contributors

gary-holloway avatar

Stargazers

 avatar

Watchers

 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.