All Projects → AndrewRadev → Inline_edit.vim

AndrewRadev / Inline_edit.vim

Edit code that's embedded within other code

Projects that are alternatives of or similar to Inline edit.vim

Shirotelin
shirotelin is Ultimate standard light colorscheme for Vim and Neovim!
Stars: ✭ 69 (-26.6%)
Mutual labels:  vim-plugin
Vim Airline Tomato
Pomodoro Technique
Stars: ✭ 79 (-15.96%)
Mutual labels:  vim-plugin
Vim Rfc
📓 Query RFC database and download RFCs from within Vim.
Stars: ✭ 88 (-6.38%)
Mutual labels:  vim-plugin
Vim Translate
A tiny translate-shell wrapper for Vim
Stars: ✭ 70 (-25.53%)
Mutual labels:  vim-plugin
Fff.vim
A plugin for vim/neovim which allows you to use fff as a file opener.
Stars: ✭ 78 (-17.02%)
Mutual labels:  vim-plugin
Vim Plugin Viewdoc
Vim plugin: flexible viewer for any documentation
Stars: ✭ 79 (-15.96%)
Mutual labels:  vim-plugin
Vim Yaml Folds
YAML, RAML, EYAML & SaltStack SLS folding for Vim
Stars: ✭ 59 (-37.23%)
Mutual labels:  vim-plugin
Rainbow
Rainbow Parentheses Improved, shorter code, no level limit, smooth and fast, powerful configuration.
Stars: ✭ 1,324 (+1308.51%)
Mutual labels:  vim-plugin
Fzf Mru.vim
Vim plugin that is using fzf.vim to display your most recently used files.
Stars: ✭ 79 (-15.96%)
Mutual labels:  vim-plugin
Todoist.nvim
A todoist extension for neovim
Stars: ✭ 84 (-10.64%)
Mutual labels:  vim-plugin
Vim Pencil
Rethinking Vim as a tool for writing
Stars: ✭ 1,186 (+1161.7%)
Mutual labels:  vim-plugin
Vim Litecorrect
Lightweight auto-correction for Vim
Stars: ✭ 77 (-18.09%)
Mutual labels:  vim-plugin
Incsearch Easymotion.vim
Stars: ✭ 82 (-12.77%)
Mutual labels:  vim-plugin
Tcomment vim
An extensible & universal comment vim-plugin that also handles embedded filetypes
Stars: ✭ 1,162 (+1136.17%)
Mutual labels:  vim-plugin
Vim Haskell Indent
If the plugin does not work for some syntax, feel free to report to the issue tracker!
Stars: ✭ 90 (-4.26%)
Mutual labels:  vim-plugin
Completor.vim
Async completion framework made ease.
Stars: ✭ 1,158 (+1131.91%)
Mutual labels:  vim-plugin
Vista.vim
🌵 Viewer & Finder for LSP symbols and tags
Stars: ✭ 1,218 (+1195.74%)
Mutual labels:  vim-plugin
Asyncrun.vim
🚀 Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
Stars: ✭ 1,332 (+1317.02%)
Mutual labels:  vim-plugin
Vim Which Key
🌷 Vim plugin that shows keybindings in popup
Stars: ✭ 1,310 (+1293.62%)
Mutual labels:  vim-plugin
Learn Vim
无废话极简版Vim学习笔记!文章按主题分拆为多个章节,并尽量控制每节的信息量;通过文字色彩和字体,将命令、快捷键突出显示;在每节结尾,提供一个命令列表,以便回顾文中介绍的重要命令。如果这些文章能对喜欢Vim的朋友有所益处,我将不胜荣幸。
Stars: ✭ 83 (-11.7%)
Mutual labels:  vim-plugin

Problem

Editing javascript within HTML is annoying. To generalize, editing code that's embedded in some different code is annoying.

Solution

Given the following example:

<script type="text/javascript">
  $(document).ready(function() {
    $('#foo').click(function() {
      alert('OK');
    });
  })
</script>

Execute :InlineEdit within the script tag. A proxy buffer is opened with only the javascript. Saving the proxy buffer updates the original one. You can reindent, lint, slice and dice as much as you like.

Check the docs for more information, see the examples directory for some example files to try it on.

If you like the plugin, consider rating it on vim.org.

What does it work for?

  • Javascript and CSS within HTML

    <head>
      <script type="text/javascript">
        $(document).ready(function() {
          $('#foo').click(function() {
            alert('OK');
          });
        })
      </script>
    
      <style>
        body {
          color: blue;
          background-color: red;
        }
      </style>
    </head>
    
  • SQL within ruby (matches "<<-SQL")

    def some_heavy_query
      execute <<-SQL
        SELECT * FROM users WHERE something = 'other';
      SQL
    end
    
  • Python multiline strings (tries to guess SQL syntax) (Thanks to @thalesmello)

    sql_query = """
        SELECT name
        FROM "Students"
        WHERE age > 10
    """
    
    print("""
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
    tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
    veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
    commodo consequat.
    
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
    dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    """)
    
  • Code within fenced markdown blocks

      Some text.
    
      ``` ruby
      def foo
        puts "OK"
      end
      ```
    
      ``` python
      def foo():
          print("OK")
      ```
    
      Some other text.
    
  • Django blocks in templates (Thanks to @Vladimiroff)

    {%  block content %}
    <h1>{{ section.title }}</h1>
    
    {% for story in story_list %}
    <h2>
      <a href="{{ story.get_absolute_url }}">
        {{ story.headline|upper }}
      </a>
    </h2>
    <p>{{ story.tease|truncatewords:"100" }}</p>
    {% endfor %}
    {% endblock %}
    
  • Heredocs in shellscript (Thanks to @fewaffles)

    cat <<-RUBY
      #! /usr/bin/env ruby
    
      puts "OK"
    RUBY
    
    cat <<PYTHON
      #! /usr/bin/env python3
    
      print("OK")
    PYTHON
    
  • Vue Single File Components (Thanks to @fvictorio)

    <template>
      <p>{{ greeting }} World!</p>
    </template>
    
    <script>
    module.exports = {
      data: function () {
        return {
          greeting: 'Hello'
        }
      }
    }
    </script>
    
    <style scoped>
    p {
      font-size: 2em;
      text-align: center;
    }
    </style>
    
  • Visual mode - any area that you mark

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].