Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chords remain fixed and independent of other chords on the same line #4

Open
gusper opened this issue Sep 3, 2018 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@gusper
Copy link
Owner

gusper commented Sep 3, 2018

Normally, when you add a few spaces to move a chord over to line up correctly with the lyrics it corresponds to, you'll also move all of the other chords on that line too. Would be handy to make spaces just move the next chord but leave others where they are.

@gusper gusper added the enhancement New feature or request label Sep 3, 2018
@aamarks
Copy link

aamarks commented May 31, 2019

One way would be to map the key bindings for editor.action.moveCarretLeftAction and editor.action.moveCarretRightAction to some control key(s) + left/right arrows. Then when the chord is selected you can slide it around without altering the adjacent chords as long as you stay between them. It would be nice to also change the punctuation/word rules so that double clicking something like G#m7 selects the whole chord. Not sure which control key/arrow combination as they do many things already.

@aamarks
Copy link

aamarks commented May 31, 2019

This works pretty nicely to slide the chord around with the arrow keys so that you don't even have to select the chord as long as the cursor is touching the chord:

	{
		"key": "ctrl+shift+alt+left",
		"command": "editor.action.moveCarretLeftAction",
		"when": "editorLangId == 'songtxt' && editorHasSelection"
	},
	{
		"key": "ctrl+shift+alt+right",
		"command": "editor.action.moveCarretRightAction",
		"when": "editorLangId == 'songtxt' && editorHasSelection"
	},
	{
		"key": "ctrl+shift+alt+left",
		"command": "editor.action.smartSelect.expand",
		"when": "editorLangId == 'songtxt' && !editorHasSelection"
	},
	{
		"key": "ctrl+shift+alt+right",
		"command": "editor.action.smartSelect.expand",
		"when": "editorLangId == 'songtxt' && !editorHasSelection"
	}

The last two auto select the chord under the cursor if not selected already.

The caveats:

  • even though I also set:
    "[songtxt]": {
        "editor.wordSeparators": "`~!@$%^&*()-=+[{]}\\|;:'\",.<>?"
    }

(removing # and /) so that double-clicking selects a chord like G#m/B, smartSelect ignores that and only selects part of the chord in those cases (you can still double click to select the chord for those troublesome cases once you realize that).

  • key bindings over-ride cursorColumnSelectRight and cursorColumnSelectLeft (I haven't found those useful editing tabs)

  • not as robust as just typing spaces ahead of chord (but then how do you know when the intention is to actually shift everything to the right farther?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants