Skip to content

Instantly share code, notes, and snippets.

@druckdev
druckdev / vim-match-selection.md
Created October 31, 2024 23:04
vim: Matching inside/outside of the visual selection

Matching inside the visual selection

To search for word inside of the selection:

/\%Vwor\%Vd

\%V matches with zero with if inside the visual selection. The second \%V makes sure that the whole word is inside of the selection. Otherwise it would also match when only the beginning is inside.

@druckdev
druckdev / refactor.md
Last active September 28, 2021 09:59
Refactoring from camelCase to snake_case (functions, variables & files)

For a project that sadly will not be made public (See PR) I had to rename some components. This is of course a very specific solution targeted only to our project but maybe it can help/give a starting point for a similar problem. Here is the documentation from the pull request:

Pull request

Trying to rename components to use the snake case naming. (See PEP 8)

I am not happy with the result that the full fledged IDE pycharm brings. (I also just dislike those super heavy programs) Since some of the variable names are used in strings to access fields in the jsons I cannot simply rename every occurrence. Pycharm gives the option to exclude matches in strings etc, but I still would have to do it for every component.