Git Product home page Git Product logo

Comments (7)

juliusHuelsmann avatar juliusHuelsmann commented on June 17, 2024

Hi! I am unsure if you potentially use a different string than the one from your question or if you are using an old version of vim-browse, I cannot reproduce the behavior you described in the question.

Behavior on the current version

on the following text:

xxx_xxx_xxx next_word ...

with cursor position on the first x.

Selection when using vE when on the first letter (indicated by [ ])

[xxx_xxx_xxx] next_word ...

Selection when using vW

[xxx_xxx_xxx n]ext_word

In general, w/W selects until the beginning of the next word (including the delimiter and the next word's first char) and e/E until the word's last letter.
Capitalization of the letter determines the set of delimiters defined as follows in the config[.def].h:

char const wDelS[] = "!\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~";
char const wDelL[] = " \t";xxx

Note that _ is not in the list of delimiters of either category.
So, in your example, ve resp vw should already do the trick.

Behavior on different string.

If your string were

xxx-xxx-xxx next_word

vw would only select xxx- and ve only xxx. However, as - is not in the array wDelL, vE and vw select the entire strings xxx-xxx-xxx n resp. xxx-xxx-xxx.

If you'ld like this to be the default behavior of vw resp ve, simply remove - from wDelS in your config.h.

I hope this helps! This wiki entry summarizes some of the commands mentioned above, and the implementation of the word movement in particular is in line 134 of file normalMode.c. If you really want to change the behavior of w by those of e, you could swap cases or simply change characters there, the simplest solution would be to delcare cs as non-const (*) and prepend swapping keys (**).

(*): Declare cs as non-const:
Replace

int executeMotion(char const cs, int len, KeySym const *const ks) {

with

int executeMotion(char cs, int len, KeySym const *const ks) { 

(**): Insert this code somewhere (e.g. line 134) or at the function's beginning.

cs = cs == 'w'  ? 'e' : cs == 'e' : 'w';

but i think this might not be what you want

from st-history-vim.

juliusHuelsmann avatar juliusHuelsmann commented on June 17, 2024

Edit
I think in your fork you use an old version of vim-browse, maybe you'ld like to update to version 2 which is available at the suckless release page, although I have to say that there is a bug withistoryh the shipped history patch (see issues). You can try out if the new patch is problematic for you workflow by trying out the patch's new version here.

You can also change the behavior in your version in normalMode.c on your version, although the code changed a bit

from st-history-vim.

zaiqiang-dong avatar zaiqiang-dong commented on June 17, 2024

Thank you very much, your answer is very useful,I will update to version 2 and recofnig it .

from st-history-vim.

juliusHuelsmann avatar juliusHuelsmann commented on June 17, 2024

Awesome :) If you have to go through the hussle of updating your vim-browse version, I recommend checking out the release page, because it takes some time until the new versions are released at the st website (i think the current version is not online yet).

from st-history-vim.

zaiqiang-dong avatar zaiqiang-dong commented on June 17, 2024

whth latest version patch i can not add scroll patch, how to fix it?
Is there documentation on how to use it ,like go to first line whit "gg" can be find answer.

from st-history-vim.

juliusHuelsmann avatar juliusHuelsmann commented on June 17, 2024

Hi! the second version uses a custom scroll patch maintained in this repo, if you rely on some of scrollback's feature you might not be able to upgrade, otherwise just apply the patch without any prerequisite patches

from st-history-vim.

zaiqiang-dong avatar zaiqiang-dong commented on June 17, 2024

OK, Thanks.

from st-history-vim.

Related Issues (18)

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.