Git Product home page Git Product logo

intellitab.nvim's Introduction

IntelliTab

IntelliTab is a small neovim plugin that fixes an annoying gripe I've had with vim's tab completion implementation for ages: pressing tab on a blank line only indents by a single space, instead of automatically indenting to your specified location.

With IntelliTab, pressing Tab works like it does on editors such as VSCode, by indenting to the same place smartindent would have indented it to if it were a new line.

Installation

Install using your favourite package manager:

Plug 'pta2002/intellitab.nvim'

Now, just rebind <Tab>:

inoremap <Tab> <CMD>lua require("intellitab").indent()<CR>

That's it!

If you are using CoC

CoC wants to have its own binding for Tab, which means it won't be compatible with intellitab by default. A solution to this is to bind Tab to this instead:

inoremap <silent><expr> <TAB>
      \ pumvisible() ? "\<C-n>" :
      \ <SID>check_back_space() ? <CMD>lua require("intellitab").indent()<CR> :
      \ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"

If you are using nvim-cmp

On the nvim-cmp setup, add this binding for tab:

['<Tab>'] = function(fallback)
  if cmp.visible() then
    cmp.select_next_item() -- or whatever else you want nvim-cmp to do when you press tab
  else
    require("intellitab").indent()
  end
end

intellitab.nvim's People

Contributors

pta2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

intellitab.nvim's Issues

fix readme:

simple grammar change of:

instalation

to:

Installation

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.