onivim / oni

Oni: Modern Modal Editing - powered by Neovim
https://www.onivim.io
MIT License
11.34k stars 298 forks source link

Insert parens closes the matching one the cursor is outside #2411

Open stoicAlchemist opened 6 years ago

stoicAlchemist commented 6 years ago

Oni Version: 0.3.6 Neovim Version (Linux only): 0.3.0 Operating System: Mac OSX

Issue: The cursor is placed after auto-closing parens

Expected behavior: The cursor should be in between the parens after auto-closing

Actual behavior: The cursor is put before or after the parens is auto-closed

Steps to reproduce: Insert parens of any kind and watch the behavior parens Adding my init.vim file to the mix

```vim " Prelude {{{ scriptencoding 'utf-8' autocmd! bufwritepost init.vim source % autocmd FocusLost * :silent! wall autocmd VimResized * :wincmd = if !exists('gui_oni') set path+=** " to use find on files endif set fileencoding=utf-8 set termencoding=utf-8 " let mapleader="," set spell spelllang=es_mx,en imap kj imap Kj imap KJ nmap i nnoremap W mz:%s/\s\+$//:let @/=''`z nnoremap :noh command! W w command! Q q cmap wq w command! Qa qa command! QA qa set backupdir=$HOME/.config/nvim/temp/backup/ set directory=$HOME/.config/nvim/temp/swap/ set viewdir=$HOME/.config/nvim/temp/view/ set undodir=$HOME/.config/nvim/temp/undo/ set backup set noswapfile set undofile " This option should be after nocompatible " '50 -> Save 50 marks " n$HOME... -> Where the viminfo file will be saved set viminfo='50,<800,/50,h,n$HOME/.config/nvim/temp/viminfo " This line can cause errors in nvim if !isdirectory(expand(&backupdir)) call mkdir(expand(&backupdir), "p") endif if !isdirectory(expand(&directory)) call mkdir(expand(&directory), "p") endif if !isdirectory(expand(&undodir)) call mkdir(expand(&undodir), "p") endif if !isdirectory(expand(&viewdir)) call mkdir(expand(&viewdir), "p") endif set autowrite set history=1000 set timeoutlen=300 set clipboard+=unnamed set autoread set viewoptions=folds,options,cursor,unix,slash " For mkview autocmd filetype crontab setlocal nobackup nowritebackup " So it works with crontab " }}} " Visual {{{ set number set relativenumber syntax on set synmaxcol=200 set list set listchars=tab:▸\ ,trail:·,eol:¬,extends:»,precedes:«,nbsp:+ set colorcolumn=81 set fillchars=diff:⣿,vert:│ set showbreak=↪ set cursorline set wrap set nrformats-=octal set encoding=utf-8 set incsearch set showcmd set laststatus=2 set showmode set lazyredraw set diffopt+=iwhite,vertical set hlsearch set ignorecase set smartcase if !exists('gui_oni') set guifont=Droid\ Sans\ Mono\ for\ Powerline\ Plus\ Nerd\ File\ Types:h11 "set guifont=Anonymice\ Nerd\ Font\ Complete\ Mono:h12 "set guifont=Dejavu\ Sans\ Mono\ for\ Powerline\ Nerd\ Font\ Complete:h12 endif set ruler " Line and column number of the cursor position set guioptions+=aceLlRrb " Need to add LlRrb to remove it " a: Selection is available to be pasted on the system and is yanked to "* reg " c: Console dialogs instead of popups " e: Show tabline set guioptions-=LlRrb set scrolloff=3 set sidescroll=1 set sidescrolloff=6 set foldlevelstart=0 set textwidth=80 if !exists('gui_oni') let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 " Set the cursor as a pipe when in insert mode " let $NVIM_TUI_ENABLE_TRUE_COLOR=1 " This is ignored if termguicolors is used set showmatch " Show matching parens when closing set matchtime=6 " Show for this amount of tenth's of a second " tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence " http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users if exists('$TMUX') let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\" let &t_EI = "\Ptmux;\\]50;CursorShape=0\x7\\\" else let &t_SI = "\]50;CursorShape=1\x7" let &t_EI = "\]50;CursorShape=0\x7" endif endif " " Formatting options: " " q Allow formatting of comments using gq " r Automatically insert the current comment leader after new line " n When formatting text, recognize numbered lists " l Long lines are not broken in insert mode " 2 When formatting text, use the indent of the second line of a paragraph " for the rest of the paragraph " j Where it makes sense, remove a comment leader when joining lines " t Auto-wrap text using textwith " c Auto-wrap comments using textwidth, inserting the current comment leader " automatically. " o Automatically insert the current commen leader after hitting o or O " v Only break a line at a blank char " set formatoptions=qrnl2jtcov " }}} " Indentation {{{ set autoindent " Copy indent in new line set smartindent " New indent level if needed set expandtab set softtabstop=2 set smarttab set tabstop=2 set shiftwidth=2 " Width to indent for >> and << operators set backspace=indent,eol,start set shiftround "}}} " Folds {{{ nnoremap za vnoremap za augroup ft_vim au! au FileType vim setlocal foldmethod=marker au FileType help setlocal textwidth=78 augroup END " }}} " Navigation {{{ nmap j nmap k nmap l nmap h " Disabling keys nmap nmap nmap nmap " In insert too imap imap imap imap " }}} " Plugins {{{ call plug#begin('~/.config/nvim/plugins') Plug 'tpope/vim-fugitive' Plug 'tpope/vim-repeat' " To repeat things that plugins do Plug 'tpope/vim-surround' Plug 'tpope/vim-eunuch' Plug 'tpope/vim-endwise' Plug 'tpope/vim-rvm' Plug 'tpope/vim-commentary' " Comment text objects Plug 'tpope/vim-jdaddy' " Json manupulation Plug 'tpope/vim-dispatch' " Send to command line and parse Plug 'tpope/vim-sleuth' " Switch indent depending on ft Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' Plug 'airblade/vim-gitgutter' " Show a gutter with hints for Git changes Plug 'vim-ruby/vim-ruby' " Ruby text Objects, motions and indents Plug 'junegunn/vim-easy-align' Plug 'vim-scripts/ruby-matchit' " Match the end word to close block Plug 'Raimondi/delimitMate' " Auto-close matching parens Plug 'vim-scripts/AnsiEsc.vim' " Color ANSI escape chars Plug 'mileszs/ack.vim' " Add command to use Ack instead of Grep Plug 'sheerun/vim-polyglot' " Most programming languages support Plug 'Yggdroot/indentLine' " Show indentation line to guide " For now, Explorer from ONI doesn't work Plug 'scrooloose/nerdtree' Plug 'Xuyuanp/nerdtree-git-plugin' " See git changes in NERDTree Plug 'tiagofumo/vim-nerdtree-syntax-highlight' " NERDTRee filetype icons Plug 'ryanoasis/vim-devicons' " Icons required by ^ if !exists('gui_oni') Plug 'tomasr/molokai' Plug 'morhetz/gruvbox' " Colorscheme Plug 'altercation/vim-colors-solarized' " Colorscheme Plug 'vim-airline/vim-airline' " Powerline for vim Plug 'vim-airline/vim-airline-themes' endif Plug 'andymass/vim-matchup' " Use % to match unsopported languages like ruby Plug 'andreshazard/vim-logreview' " Log reviewer call plug#end() filetype plugin indent on " }}} " Plugin Configs {{{ " EasyAlign {{{ vmap (EasyAlign) " }}} " Autocomplete options {{{ set complete=.,w,b,u,t set completeopt=longest,menuone,preview " Ignore directories and files set wildignore+=*.DS_Store set wildignore+=*/_build** set wildignore+=*/.ssh set wildignore+=*/.npm set wildignore+=*cache/** " }}} if !exists('gui_oni') " Colorscheme {{{ set termguicolors set t_Co=256 set t_AB=^[[48;5;%dm set t_AF=^[[38;5;%dm colorscheme molokai hi clear SpellBad hi SpellBad cterm=underline " }}} endif " IndentLine {{{ let g:indent_guides_start_level=2 let g:indent_guides_guide_size=1 let g:indentLine_char='│' " }}} " Nerdtree Config {{{ nnoremap t :NERDTreeToggle autocmd FileType nerdtree setlocal nolist "}}}" " Nerdtree git Config {{{ let g:NERDTreeIndicatorMapCustom = { \ "Modified" : "✹", \ "Staged" : "✚", \ "Untracked" : "✭", \ "Renamed" : "➜", \ "Unmerged" : "═", \ "Deleted" : "✖", \ "Dirty" : "✗", \ "Clean" : "✔︎", \ "Unknown" : "?" \ } " }}} if !exists('gui_oni') " Airline {{{ if !exists('g:airline_symbols') let g:airline_symbols = {} let g:airline_powerline_fonts = 1 endif let g:airline_left_sep = '⮀' let g:airline_left_alt_sep = '⮁' let g:airline_right_sep = '⮂' let g:airline_right_alt_sep = '⮃' let g:airline_symbols.branch = '⭠' let g:airline_symbols.readonly = '⭤' let g:airline_symbols.linenr = '⭡' " }}} endif " FZF {{{ nmap f :Files nmap b :Buffers "}}} if has("unix") let s:uname = system("uname -s") if match(s:uname, "arwin") && !exists("Ctags") command! Ctags execute "!`brew --prefix`/bin/ctags -R ." endif endif " }}}" ```
stoicAlchemist commented 6 years ago

Sorry for the mess, I'm trying to get my init.vim file to be better formatted

TalAmuyal commented 6 years ago

I didn't read your configs.. On I has auto closing plug-in and that might be colliding with a plug-in from your configs.

If you do have such a plug-in, try disabeling one of them.

On Sun, Jul 8, 2018, 00:07 Brian I. Martínez Estrada < notifications@github.com> wrote:

Sorry for the mess, I'm trying to get my init.vim file to be better formatted

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/onivim/oni/issues/2411#issuecomment-403242927, or mute the thread https://github.com/notifications/unsubscribe-auth/AE3IjYEIoqrLbDWtwhFwD4aYckuOd74tks5uESMjgaJpZM4VGfjF .

stoicAlchemist commented 6 years ago

It's dissabled, it's not the plugin, (tested that before submitting)