Text editors, IDEs

From Helpful
(Redirected from Text editors)
Jump to navigation Jump to search

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.


Text editors

Markers:

  • (+ssh) can load and save over ssh mostly transparently (Note also that applications like WinSCP also allow a decent solution for remote editing through watching local changes on files you have opened.)
  • (-syntax) does not have syntax highlighting (most do, though language supports always varies)

Pretty much all of the below do syntax highlighting.


Windows

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.
  • notepad (-syntax)
  • Notepad2 (third party; simple like notepad, but with syntax highlighting and a few other handy things)
  • notepad++
  • ultraedit (+ssh)

Linux

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.


  • kate (+ssh)
  • kwrite (+ssh)
  • kdevelop (+ssh)
  • NVU (web-specific)


Unsorted

programmer tools indent, astyle


IDEs

Visual Studio Code

vscode is an editor ('Visual Studio' seems to be mentioned only for branding reasons, it shares little with VS) that runs in win+lin+osx (because it is itself a browser+javascript based thing).

More interestingly, it happens to take extensions to do a lot of things, so with enough added installation it can be a full-blown IDE, supporting more languages that targeted IDEs. (That said, if you're developing for windows, you may be better of with Visual Studio, community edition)


It lets you work remotely, over SSH[1].


vscode keyboard shortcuts

  • F1 - command palette (including things that extensions provide)
  • F12 - go to definition (this feature seems increasingly broken, though?)
CtrlK F12 - show definition to the side


  • CtrlK Z - Zen mode (uncluttered), EscEsc to quit)


  • CtrlShiftSpace - show function parameter help


Overview

  • CtrlShift[, CtrlShift] - fold/expand code block
  • F8 - go to next problem


Formatting, refactoring and such

  • AltUp, AltDown - move line
  • Without a selection, CtrlX, CtrlC work on the line you're on.
  • Ctrl[, Ctrl] - indentation
  • Ctrl/ - toggle comments


  • CtrlH
CtrlShiftH - replace in many files (which exactly, though? All in workspace?)
  • F2 - rename symbol (more language-aware replace)


Multi-cursor

CtrlAltUp / CtrlAltDown - put cursor in same position on previous/next line
AltClick - add via mouse
CtrlD selects next occurrence of the word you're currently on (by substring, not symbol?)
CtrlF2 selects all occurrences (by substring, not symbol)

Issues

lots of memory / CPU use
cannot activate the X extension because it depends on the Y extension

Seems moderately likely to be some incompatibility between local and remote versions.

uninstall python, pylance, and jupyter (whichever of them you have) and installing them again is one good way to update them and tends to solve a lot of cases.



If each vscode client gets confused about what's on a single server state, and each needs to alter both sides' state to fix it, that may be the cause of the problem in the first place, so... good luck playing whack-a-mole.


Why would reloading the window help?

Iono.


Unable to watch for file changes. Please follow the instructions link to resolve this issue.
This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

When logged into a linux server, inotify is used to get sooner-rather-than-later updates about what files other programs change within the workspace.


The lazy thing is to increase the amount of things that can be watched.

There is a default maximum to how many files eac user can watch via inotify - classically 8K, now more often tens of thousands, which should be enough for most workspaces.

Things to check

  • current limit, e.g. Template:Inlineode
  • symlinks -- I had a slimmed down dev environment that happened to symlink to a directory containing a half-a-million-file dataset.


Also keep in mind that remote logins to the same user will each watch the same set of things. In my case each adds 25K watches.


But maybe you actually want to reduce that.

  • Seeing what files are watched
    • If you can restart (and don't mind running an instance from the CLI you will want to quit later), you can do strace -fe inotify_add_watch code
    • If you need it on an already-started instance, then note this is not a fast query, because it watches inodes, and to get filenames from inodes isn't a cheap operation
also there is no existing tool, but things like inotify-info help


  • to exclude things, see vscode's files.watcherExclude setting. This seems to by default already exclude things like:
**/.git/objects/**
**/.git/subtree-cache/**
**/node_modules/*/**
**/.hg/store/**


See also: https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc

"Go to definition" doesn't function
This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

Note that how this functions, and why it breaks, varies a little by langauge.





pylance doesn't function

It does that. Try to install a different version and see if that helps.


pylance talks nonsense, seems to be talking about completely different code

Yeahhhh... I dunno yet.


One issue I suspect is related is that pylance extension doesn't seem to prioritize reporting on the code actually open above reading (large) data files in the same directory - it would get behind.



Visual Studio

Zed (osx)

https://zed.dev/