Contents

Switching to Cursor

The Old Setup

For years, I’ve been using a combination of different editors for my work:

  1. Sublime Text for LaTeX documents - lightweight, fast, and with great syntax highlighting
  2. PyCharm for Python development - powerful IDE with excellent debugging and refactoring tools

While the setup worked well, it had its drawbacks:

  1. Having to switch between different editors for different tasks
  2. Maintaining separate configurations and plugins
  3. Although I use VIM, there are different editor-specific keyboard shortcuts to remember
  4. PyCharm sometimes can be quite slow, with execessive indexing

Why Cursor?

Cursor has become my go-to editor for both LaTeX and Python development for several reasons:

  1. AI-Powered Features:

    • Intelligent code completion (agent-mode chat, tab completion)
  2. Unified Environment: One editor for all my needs means:

    • Consistent interface and shortcuts
    • Single configuration to maintain

Configuration tips

Using Cursor for LaTex is straighforward. One only needs to install the Latex Workshop plugin here. There is even an internal PDF viewer so one doesn’t have to link Cursor to an external viewer like Skim. All in one, the transition from Sublime to Cursor is surprisingly smooth.

To transition from PyCharm to Cursor for Python development, one needs a bit more work.

The most important feature for me in PyCharm is (1) the console, an interactive environment where I can quickly run a selection of codes to experiment out codes; (2) data browswer to quickly view variables/data.

  1. I use the Interactive Window that integrates Jupyter Notebook, which offers the same, actually even better, interactive coding experience. For example,now I can modify and re-run code cells on the fly without having to re-execute the entire script.

  2. I use Data Wrangler to view variables/data.

  3. I need to fix some shortcuts to make the process work:

    1. I need to turn on the option to allow me to send codes from my main editor to the interactive window. Two steps:
      • First, I need to remove the shortcut Shift + Enter to send codes to the interactive mode in Terminal
      • Second, I need to tick the JupyterNote book setting:
        1
        2
        
        Jupyter › Interactive Window › Text Editor: Execute Selection
        When pressing shift+enter, send selected code in a Python file to the Jupyter interactive window as opposed to the Python terminal
        
    2. One needs to add a new shortcut to toggle between the JupyterNotebook cell section and the input box:
      1
      2
      3
      4
      5
      
      {
        "key": "cmd+up",
        "command": "interactive.history.focus",
        "when": "isCompositeNotebook && !notebookEditorFocused"
      }