VSCodeVim / VSCodeVim/Vim

Seperate JSX and function blocks from parent parentheses or parent tag

Open
#4,249 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

let say I have a React Component (class based for now, yeah i should start using hooks =D)

class App extends Component {
  state = {
    someState: ""
  }  

  render() {
    return (
      <View>
        <View>
          <Text>Header</Text>
        </View>
        
        <View>
          <Text>Main</Text>
        </View>
  
        <View styles={styles.footer}>
          <Text>Footer</Text>
        </View>
      </View>
    )
  }
}

Now i am using vimvscode so i use shift + [ or shift + ] a lot;

now let say i need to delete

state = {
  someState: ""
}

for me i think best way to delete that part i d + shift + [
if my cursor is at

  state = {
    someState: ""
  }[Cursor]

but it will delete up to class App extends Component

same goes for JSX

if i want to delete footer only

<View styles={styles.footer}>
  <Text>Footer<Text>
</View>  

with d + shift + ] if my cursor is at:

it will delete all upto:

        <View styles={styles.footer}>
          <Text>Footer</Text>
        </View>
      </View>
    )
  }
}

I don't want this behaviour,

so i would love to know any prettier configuration or vim plugin that can help me do these stuff

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by examining how VSCodeVim handles bracket motions for JavaScript and JSX, then determine whether configuration or plugin support can provide the requested boundaries; done means deletion stops at the intended function or JSX block rather than the surrounding parent structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, typescript, vim, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.