Comments (6)
you will get a beer on the next chaos communication camp.
i learned vim in one of your courses at ohm ;-)
from switch.vim.
Hey Andrew, i really like your plugin! Thx for the awesome work! I use it many times daily.
Thank you for the kind words :).
I want to switch between the following variable declarations:
Try putting this in ~/.vim/ftplugin/sh.vim
, so it gets run for every bash file:
let b:switch_custom_definitions =
\ [
\ {
\ '$\(\k\+\)': '${\1}',
\ '${\(\k\+\)}': '"${\1}"',
\ '"${\(\k\+\)}"': '$\1',
\ }
\ ]
The first transforms "$ followed by only keyword charactersinto
${..}, the second matches
$, then {, then keyword characters, then }`, and you can guess the third.
from switch.vim.
Hey Andrew,
thx for your fast reply!
i tested it and it has a little problem with underscores in the var name.
"${OPT_PATH_PATCH}"
is switching to
"${OPTPATHPATCH}"
do you have a hint on how to make it underscore aware?
i will only use uppercase and lowercase letters and underscores in my variable names.
thx again!
from switch.vim.
To me, this seems like a conflict with some other switch mapping. Is it possible you have the example from the documentation installed that transforms snake_case
into camelCase
? As I said in the docs:
Note that this particular example is NOT included as a built-in, since it may overshadow other ones and is probably not that useful, either
I'd recommend you only add that example as a buffer-local one for filetypes you tend to use it often, or add it with a different mapping, like I suggest here:
Lines 295 to 306 in 8f76655
Could you check if this is, in fact, the problem?
from switch.vim.
you were right.
i have it running now.
thx a lot!
this will really give me a timeboost :-)
from switch.vim.
Excellent, I'm glad to hear I've been managing to recruit people to the Vim side :D. I'll try to remember to collect that beer!
from switch.vim.
Related Issues (20)
- Switch.vim pollutes search history HOT 2
- Add case insesitivity HOT 2
- Does not working eruby_tag_type in eruby filetype. HOT 4
- [wiki] Anyone know how to write a substitution for React props? HOT 3
- Invert logical expression, using De Morgan Law HOT 1
- "." repeats always forward, even if the last used command was "SwitchReverse" HOT 2
- Undefined variable: g:switch_builtins and invalid expression error on startup when opening a Ruby file and loading the plugin through NeoBundle HOT 2
- Enable js toggles for typescript, typescript.tsx filetypes HOT 2
- switch#NormalizedCase and word boundaries HOT 3
- increase/decrease number HOT 2
- Switching all the flags at once HOT 2
- Possible to call normal commands in switch definition? HOT 10
- Enable switching booleans anywhere on the line and returning to original cursor position HOT 6
- Introduce a way to set priority/precedence? HOT 9
- Idea: Multiple switch alternatives HOT 3
- Comparison to swapit HOT 2
- can you please add a configuration example for lua HOT 2
- NormalizedCaseWords does not work for capitalized words HOT 2
- Patch to allow reverse action (and count) in lambda substitutions HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from switch.vim.