Git Product home page Git Product logo

clever-f.vim's Introduction

              eval                                                   ($s=
              %w(s                                                   =%(e
              val(                                                   $s=%
w(#{  $s})*   "")) ;puts(   ["1f       wnv1    q4xrvp4w0       ","1f wnv1
q4xrvp4w0",   "1fwnv1q4xrv   p4w0     ","1    hl0q9  deze     aku6n","1jc
anpzbo        dnf30   f","    1hu9   1oef     gwcf           dxb"   ,"1g0
31fmt         9cb4    oin"     ,"1g 03kv       fpbxhgtu7     ","     1hua
2h60          ublv    rwv"      ,"1jcap           kghtdfp    6hb     ","1
hl0g          adpk    99w2       6n","        fjd    9fk0    ","7   n8t7n
k"].          map{    |l|(       (0..         72).map{|i|     l.to_i(36)[
i]>0          ?s.s    lice      !(0)             :32.ch        r}*"" ).rs
                             trip})
                             )*"")

Run this code

dogs respected

code icon Programming languages

  • Dachs: My own programming language. It is a statically typed GCed language with Ruby-inspired syntax, and compiled to executable with LLVM (unmaintained)
  • gocaml: Small subset of OCaml with level-based polymorphic Hindley Milner type inference in Go, and compiled to executable with LLVM
  • wain: WebAssembly interpreter implemented with zero dependencies in Safe Rust

browser icon Web apps

  • vim.wasm: Vim editor ported to browsers with WebAssembly, TypeScript and Web Worker

term icon Commandline tools

  • kiro-editor: Small UTF-8 text editor on terminal written in Rust
  • git-brws: Quickly open various pages in several Git hosting services
  • dotfiles: CLI utility to manage 'dotfiles' with symbolic links
  • actionlint: Static checker for GitHub Actions workflow files
  • hgrep: Grep with human-friendly search results

desktop icon Desktop applications

  • NyaoVim: Web-enhanced extensible Neovim frontend built with Electron, Web Components and TypeScript (unmaintained)
  • Shiba: Markdown live preview app integrating a linter built with Electron and TypeScript, being rewritten with Rust using OS-specific WebView

tools icon Maintainer

clever-f.vim's People

Contributors

bertrandsim avatar elyscape avatar enzime avatar hiroebe avatar huxpro avatar ichizok avatar jidhub avatar kadamski avatar matsui54 avatar pocke avatar r6eve avatar rbtnn avatar rhysd avatar tafryn avatar thinca avatar yuntan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clever-f.vim's Issues

clever-f conflicts with ale

I'm getting this error occasionally when using clever-f. It seems to be related to https://github.com/w0rp/ale but I'm not really sure what the error is trying to tell me nor whether the issue is with clever-f or ale.

Error detected while processing function clever_f#find_with[31]..<SNR>223_getchar[2]..<SNR>151_NeoVimCallback[29]..<SNR>112_HandleExit[43]..ale#engine#HandleLoclist[33]..ale#engine#SetResults[26]..ale#cursor#EchoCursorWarning[1]..ale#CallWithCooldown[9]..<SNR>118_EchoImpl[20]..ale#cursor#TruncatedEcho:
line   15:
E523: Not allowed here

Any help would be greatly appreciated ๐Ÿ™

clever-f triggered by any use of f or t in normal mode

I have a map in one of my user-written plugin files, <Leader>fs, that manually applies a syntax highlight fix. I have let mapleader="," in my maps configuration, so the actual map is ,fs. This map keeps triggering clever-f on me, and invokes a forward-find of the character s. On immediate reuse of the map, it'll break the map and invoke a substitution action on the character under the cursor.

Additionally, if I type :help clever-f<CR>, I do indeed get the help docs for clever-f, but with all of the carriage returns highlighted. It seems as if clever-f is being triggered by any use of f/t/F/T while in normal mode, regardless of its context.

'fFtT' keys can not be input on select mode

map f ใ•ใ‚Œใฆใ„ใ‚‹ใฎใง fFtT ใฎใ‚ญใƒผใŒใ‚ปใƒฌใ‚ฏใƒˆใƒขใƒผใƒ‰ใงๅ…ฅๅŠ›ใงใใพใ›ใ‚“ใ€‚
ใ‚ปใƒฌใ‚ฏใƒˆใƒขใƒผใƒ‰ใงใฏๅฐๅญ—ๅฏ่ƒฝๆ–‡ๅญ—ใ‚’ๅ…ฅๅŠ›ใ™ใ‚‹ใจใ€้ธๆŠž็ฏ„ๅ›ฒใŒๅ…ฅๅŠ›ๆ–‡ๅญ—ใง็ฝฎๆ›ใ•ใ‚Œใ‚‹ใ“ใจใŒๆœŸๅพ…ใ•ใ‚Œใฆใ„ใ‚‹ใฎใงใ“ใฎๆŒ™ๅ‹•ใฏ neosnippet ใชใฉใ‚ปใƒฌใ‚ฏใƒˆใƒขใƒผใƒ‰ใ‚’ๅˆฉ็”จใ™ใ‚‹ใƒ—ใƒฉใ‚ฐใ‚คใƒณใงๅ•้กŒใ‚’่ตทใ“ใ—ใพใ™ใ€‚ See :h Select-mode-mapping

ๅ†็พๆ‰‹้ †

  1. ้ฉๅฝ“ใซๆ–‡็ซ ใ‚’ๆ‰“ใค
  2. v<C-g> ใงใ‚ปใƒฌใ‚ฏใƒˆใƒขใƒผใƒ‰ใซใชใ‚‹
  3. fFtT ใŒๅ…ฅๅŠ›ใงใใชใ„

Remap the "t" key to another one ?

Hello !
Thanks for this smart plugin. Would there be a simple way to replace "t" by "j" because I use a different keyboardmap ? (bรฉpo which is the french Dvorak sort of. j is already remapped as t in my vimrc and t to j but the plugin overwrite this remapping that is done with nnoremap).
Thanks and have a good day !

Repeat `f` mapping with `.` generates garbage in command line.

How to reproduce

dfa โ†’ .

At first, the area which begins at cursor and ends at a would be deleted. And then, the same action is executed by ..
However, the second action generates below garbage in command line:

:call clever_f#find('f', 60)

`<Plug>(clever-f-reset)` doesn't reset highlight

I have the following map in my config:
nmap <Esc> <Plug>(clever-f-reset)

Moving the cursor resets the highlights, but pressing <Esc> doesn't. However, it does reset the searching character.

enable highlights for next matching lines?

Because clever-f is capable of traversing lines, I think that it would be quite helpful if we could configure it to highlight further out so we know where we will be landing. Of course, highlighting all of the matching chars in the entire buffer is probably too extreme, but somebody might want to do that as well!

Mainly I just want to be able to at least see the next line having the match. So, if i fZ and there is a Z 5 lines further down in the buffer, i'd like that to get highlighted as well as the Z's on the current line. No need to highlight more than the next match away from the current line.

Thank you!

Not an issue - just wanted to say thank you! This plugin rocks.

Breaks macros

Say you have the following line 1a 2a 3a 4a 5a, and you wish to delete all of the a in this line, to do this you record the following macro: qqfax which leaves you with the following line after recording: 1 2a 3a 4a 5a. from there, to delete the rest of the a you would simply call the macro by doing 4@q.

Expected Behaviour

to get a line like this: 1 2 3 4 5

Actual Behaviour

1 2axfaxfaxfax 3a 4a 5a

steps to reproduce

  1. qq start macro
  2. fax (find next a and delete it with the x key)
  3. q
  4. 4@q

vim

neovim 0.5.0 nightly (bare config)

Enhancement: Modifiable clever_f_chars_match_any_signs list

I most cases when i hit "f;" (search and go to any sign) i get too many variants. As a result - i've tried it a couple of times and just do not use since.

Could you please add an option like "clever_f_chars_any_signs list" with possibility to limit the list?
".", ",", "_", " ' " are easy to jump by their original name (e.g. "f.")

Disappear cursor icon's color.

Description

Disapper cursor color by executing clerver-f

https://vim-jp.slack.com/archives/C03C4RC9F/p1562727930036200

Reproduce process

  1. Hit f
  2. Hit key to jump char

Environment

  • OS : Windows 10
  • vim: kaoriya-gvim
  • version: 8.1.1461

Minimum setting

if &compatible
  set nocompatible               " Be iMproved
endif

if empty(glob('c:/nekowasabi/tools/vim/vim81/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
        \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  autocmd VimEnter * PlugInstall | source $MYVIMRC
endif

call plug#begin('c:/nekowasabi/tools/vim/vim81/plugged')
Plug 'rhysd/clever-f.vim'
nmap f <Plug>(clever-f-f)
xmap f <Plug>(clever-f-f)
omap f <Plug>(clever-f-f)
nmap F <Plug>(clever-f-F)
xmap F <Plug>(clever-f-F)
omap F <Plug>(clever-f-F)

Making semicolon behaving like f/t?

Many vimers might have got used to type ; for repeating after forward or toward. So It might be reasonable to map ; with same behaviour as well?

Any thoughts?

Breaks macros after second press of t or f

Say you have the following line a,, b,, and you wish to delete the extra , after each letter, to do this you record the following macro: qqf,fx which leaves you with the following line after recording: a, b,, then you would run the macro again with @q

Expected Behaviour

to get a line like this: a, b,

Actual Behaviour

a,b,,

steps to reproduce

  1. qq start macro
  2. f,fx (find a comma, then go to the next comma and press x to delete the character)
  3. q to stop the macro
  4. @q to run the macro

vim

neovim 0.5.0 nightly (bare config)

add number of character

I has a good idea. When i type f{char},addition to highlighting character, also can show numbers around characters(the number of repetitions of that character). Then i can type {count}f to jump.

Mark character color, how get it working?

Thanks for sharing this awesome plugin! How does g:clever_f_mark_char_color work? I found no example by yet.

For example, when I do: g:clever_f_mark_char_color="Statement"

And in my colorscheme the Statement is defined as:

hi Statement guifg=#8a3824 guibg=NONE guisp=NONE gui=bold

But I see no another colors of the matching character when I press f{insert character} ?

More persistent repeating

When after using clever-f, say 'fj' and typing something in insert mode it is not possible to repeat the same search again.
Without clever f I would do 'fjiTYPING;.' to jump again and repeat typing again. But in case of clever-f ';' doesn't work anymore and 'f' itself asks for a character.

Is it possible to fix ';' and '.' keys while they are needed sometimes?

Thanks.

mapping `clever-f-reset` doesn't work

or I'm too dumb to get it right ... ^^

I tried as normal with:

nm <Leader>f          <Plug>(clever-f-reset)

with , as leader. When I do this f doesn't work anymore. Ther cursor jumps to the status line when I press f and return to previous position when I press another key to search for that character. But it doesn't search any more :(

Using f for next search

Hi, thanks for a great plugin. I have a question. Is there a way to exit f-repeating mode?
Now, to make another search instead of repeating, I'm pressing some random key.
Is it possible to make some mapping like map <esc> call f-repeating-mode-exit().
Thanks in advance

Feature Request: Reset highlights when <Esc> key is pressed

I have this mapping to clear/reset the Vim's search results highlights (i.e. when using /):

nnoremap <Esc> :noh<CR>

So, I'm thinking if it's possible to use the <Esc> key also to reset the clever-f highlights instead of using the cursor keys?

Highlight won't be cleared until the cursor moves.

I think it's better UX than using g:clever_f_highlight_timeout_ms since sometimes you're not done yet, but the highlight will be auto-cleared. Clearing it on-demand offers more timing control. I think <Esc> is also a natural choice since it's kinda escaping the clever-f (find) mode.

BTW, thanks a lot for this useful/practical plugin! :)

Introduction in documentation is a little unclear

In doc/clever-f.txt, it says

|F| after |f|{char} and |F|{char} is also available to undo a jump.

This is a little unclear because doing something like fpFF starting at "start here"

first p second p start here third p

Will take you back to the first p rather than one of the other ones.

Repeat like key pressed to repeat

If you jump to a character x, using fx, then both f and t will jump to the next occurrence of x, but t does the same (i.e. it just repeats the initial fx jump).

IMHO, f should do a further jump in a f-ish way, and t in a t-ish way, independently of whether the initial jump was fx or tx. For instance, fxt should jump to before the second occurrence of x. Of course, likewise for any permutation of f, F, t, T.

unmap T

How to unmap T key in init.vim

cursor position not right when `set selection=exclusive`

to reproduce:

  1. set selection=exclusive

  2. assume we have these text (| means cursor position)

     |abcdef
    
  3. v to enter visual mode

  4. press fc

    • with clever-f, the result would be (ab selected)

        ab|cdef
      
    • without clever-f, the right result should be (abc selected)

        abc|def
      

ct/cf combinations change cursor appearance

Looks like plugin resets some cursor attributes after ct/cf combinations, before the change my cursor was horizontal, but after ct command it became a block:
ะธัŽะปั-22-2019 16-45-06
Tried to disable plugin in .vimrc and it helped, so I'm sure problem related to the plugin. If there's some hotfix, that I can paste in my .vimrc I would appreciate it.

Guicursor is overwritten with neovim

I have the following to change my cursor from a block into an underline:

set guicursor=a:hor20-Cursor

Whenever I run df to delete a range, my cursor is changed back to a block.

I have to source my config to have it as an underscore again.

This behaviour seems to happen only with Neovim and not Vim itself.

Breaks with period character

Given this line of Ruby (_ == cursor):

    expect(Lib::_Version.to_s).to be_a String

In normal mode, if I do f., it repeats my previous action (in this case, text substitution) instead of jumping to the . character.

E523 in nvim_buf_set_lines

Have been using clever-f for a really long time. Recently, I encounter an error that is shown below

image

I am using fidget.nvim to show the progress of LSP. I am not sure whether this issue is caused by clever-f or fidget.nvim. It seems that this issue is related to neovim/neovim#16278, i.e., the <expr> + getchar() thing.

This issue happens during the initialization of the LSP servers. After the initialization, no issues.

Nvim version: NVIM v0.7.0-dev+1429-g8bdcd832a

Thank you very much.

Clever-f jumps to wrong characters

Clever-f jumps to wrong characters, If clever-f set like below.
let g:clever_f_ignore_case = 1
let g:clever_f_use_migemo = 1
let g:clever_f_across_no_line = 0

Then, typing "fs" jumps to not only "s" but also "o"
test

Enhancement: combine clever-f with shot-f

I just stumbled acros deris/vim-shot-f plugin which is a really nice feature for the f,F,t,T keys. But sadly it does not work with clever-f which I like even more :)

Is there a chance to combine them or implement something similar in clever-f? I might be able to do the implementation if I get some pointers.

Breaks lazyredraw

when using a macro with lazyredraw on, the screen should not redraw, but when using f, F, t and T, the screen will always redraw.

I tested this with a bare neovim config

f and t in macros

It doesn't look like f and t work in user recorded macros, example:

qqfaq

would record a macro that moves to the next 'a' in a line. If I do that, then move to another line and call it via:

@q

nothing happens. Is this something that could be added? Great plugin, thanks!

Navigate only certain characters?

Is it possible to add an option to make clever-f to navigate only certain characters? Like, the beginning and end of words or camelCased words, and the non-alpha characters?

How can I map `f` and `F` only?

issueใงใฏใชใ„ใฎใงใ™ใŒ่ณชๅ•ใŒใ‚ใ‚Šใ€ๆŠ•็ฅจใ•ใ›ใฆใ„ใŸใ ใใพใ—ใŸใ€‚

clever-fใซใคใ„ใฆf F t T ใฎ4็จฎ้กžใฎๆ–‡ๅญ—ใซใฆๆคœ็ดขใ‚’่กŒใ†ใ“ใจใŒใงใใพใ™ใ‚ˆใญใ€‚
ใ“ใ‚Œใซๅฏพใ—ใฆf, F ใฎใฟใ‚’ๅ‹•ไฝœใ•ใ›ใฆใ€€t T ใ‚’ๅ‹•ไฝœใ•ใ›ใชใ„ใ‚ˆใ†ใซใ—ใŸใ„ใจ่€ƒใˆใพใ—ใŸใ€‚

clever-f.vim / plugin / clever-f.vimใฎ

noremap (clever-f-t) clever_f#find_with('t')
noremap (clever-f-T) clever_f#find_with('T')

ใ‚’ใ‚ณใƒกใƒณใƒˆใ‚ขใ‚ฆใƒˆใ•ใ›ใ‚‹ใ“ใจใงๅ‡บๆฅใ‚‹ใฎใ‹ใจๆ€ใ„ใพใ—ใŸใŒ้•ใ„ใพใ—ใŸใ€‚
ใฉใฎใ‚ˆใ†ใซใ„ใ˜ใ‚Œใฐใ‚ˆใ‚ใ—ใ„ใฎใงใ—ใ‚‡ใ†ใ‹ใ€‚
ใŠๅฟ™ใ—ใ„ใจใฏๆ€ใ„ใพใ™ใŒใ‚ˆใ‚ใ—ใใŠ้ก˜ใ„ใ—ใพใ™ใ€‚

Reset repeat on Escape

Is there a quick option to make clever-f forget about the character to search not only on movement, but also on Esc.
After all, 'f' is not so consistent when:

input    fa      x fa
move   ---->_----->_
text   1    abc   da

This is as expected (cursor stays still), but:

input    fa    d0 fa
move   ---->_
move   _<
text   1    abc   da

In this case cursor moves and clever-f won't find next match anymore.

Would be nice if there were an option not to rely on previous_pos, and just reset clever-f on Esc (or C-f?).

I have tried, but my VimL skills are poor.

Clear highlights after timeout

Just found this addon and I really like it!

One thing that struck me though is that if you set a timeout the highlights remain even after it's triggered. I think it would make sense to clear them once you no longer have the option to jump to them without starting a new search.

visual mode t/T repeat

t/T doesn't work in visual mode
reason: s:first_move is never reset to 0 when in visual mode
see autoload/clever_f.vim line 181

should be easy to fix :)

Error: Argument of map() must be a List or Dictionary

After I press "fs" to jump to 's' character i got this error:

Error detected while processing function clever_f#find_with:
line   40:
E712: Argument of map() must be a List or Dictionary

Removing this setting making it works again:
let g:clever_f_repeat_last_char_inputs='<Tab>'

My vim version is:

NVIM v0.4.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNUP

Cursor stuck as underscore after autocompletion

First of all, I discovered this plugin today and am really enjoying it so far so thanks!

After installing the plugin I was getting some weird cursor issues and managed to find this related issue, which fixed my problem, but I wanted to open an issue here to point to the solution to help others in the future if they run into the same problem.

I was using all default params for clever-f with Shougo/deoplete.nvim as my autocompleter (not sure if it matters)

Here's a short video that shows the problem. Before my cursor is a block, then goes into underline mode when i enter Insert mode. After I take the autocompletion my cursor is permanently stuck in underline mode (both when in Normal mode and Insert mode).

vokoscreen-2019-02-20_16-48-28

Just add the following to your vimrc
let g:clever_f_hide_cursor_on_cmdline = 0
neovim/neovim#6913
credit to @zhou13

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.