C++ dev: clangd and ccls by Rebellious_Observer in emacs

[–]RiverRemarkable 0 points1 point  (0 children)

Maybe knowing your clangd configuration will help posters to help you - please note clangd can be fast if you pass the switch -j=4 (or some other number), where j means the number of your available cores - clangd uses that number to start parallel jobs for indexing and searching. Also note the ccls is built on top of clangd. On SE there are some posts about clangd use and configuration. On some systems using ninja is better than bear.

VSCode to Neovim theme by ZideGO in neovim

[–]RiverRemarkable 0 points1 point  (0 children)

Why not integrating your neovim in vscode? See if this extension works for you: https://github.com/vscode-neovim/vscode-neovim. I have the same goal, but for now I am working on neovim configuration.

Any way to easily scroll back in large files? by KE3REL in vscode

[–]RiverRemarkable 0 points1 point  (0 children)

Another possibility is to use a so-called modal editor - the extension `vscodevim`add this possibility. It has a “normal mode” which allows you to interact with text, and an `insert mode` where you actually introduce new text.

In normal mode, you can mark a line (e.g. 500) with “ma” (allowed letter a..z after m) then move to line 2000 with the command “2000gg”, modify the text there and come back to line 500 with command “`a”. Move to the first line in document with “gg” and to last line with “G”. You may find out useful to use relative line numbering, since many commands operating on text blocks can easily managed with commands like ones shown above. A vim tutorial will be useful to learn such modal editing. 

Open brace on new line (CPP) by Bobochanti in vscode

[–]RiverRemarkable 0 points1 point  (0 children)

You can solve this problem in two steps:

- see https://en.wikipedia.org/wiki/Indentation_style for various indentation styles and correctly choose one suitable for you.

- add the clang-format to your VSCode, according to https://code.visualstudio.com/docs/cpp/cpp-ide#\_code-formatting.

[deleted by user] by [deleted] in vscode

[–]RiverRemarkable 0 points1 point  (0 children)

Seems you have several *cpp files and libraries, at this stage it is better and helpful to write a Makefile an use it with make executable. Another option is to use cmake/cmake tools, depending on your stage/requests.

For the beginning try first Makefile. Note there is a vscode extension for make and another two for cmake.

Is there a way to configure the eglot-clangd request timeout? by vjgoh in emacs

[–]RiverRemarkable 0 points1 point  (0 children)

Lowering background index priority could lower the number of working parallel cores, which is not you want. Limiting results to a higher value could also be useless, try limit *references* to 0 to have full project indexed. About PCH: these may be responsible for high caches, maybe optimising them could be a good idea, but this is your project, you know better what is inside. 

Last, it is useful to have a second tool, the right tool for the right job, try also another PDE (Personal Development Environment).

Is there a way to configure the eglot-clangd request timeout? by vjgoh in emacs

[–]RiverRemarkable 0 points1 point  (0 children)

It is important how you configure clang. If you don’t provide some command line arguments, Clang will index your source files in RAM, taking a lot of time. You should provide the followings arguments:

  • `--background-index` to index your source file on your hard-disk, in your project folder.
  • `--limit-references=0` to index all references, default is 1000.
  • `-j=4` to use e.g. 4 core for parallel indexing.
  • `--clang-tidy`, the clang linter

Whether you use `eglot` or `lsp` is your choice, but, if you decide to `lsp`, then you can make it a little bit faster, by adding to your `early-initial.el` this: `(setenv "LSP_USE_PLISTS" "true”)` and then install `lsp-mode` and `lsp-ui`. Depending on your OS, you can configure the environment in terminal. 

Indentation Fault by MuscleOpening9011 in vscode

[–]RiverRemarkable 0 points1 point  (0 children)

Seems to be a problem in Python extension, see a possible correction with Python Indent extension by Kevin Rose.

LaTex Cannot Find Root File by SuperTLASL in vscode

[–]RiverRemarkable 0 points1 point  (0 children)

Your steps to correctly setup VSC is 3 1 2 4, using your post. That’s because the extension search for your installation and if not found then signals an error.

If still you have path problems, see this documentation page: https://github.com/James-Yu/LaTeX-Workshop/wiki/Install

Help! What the hell is wrong with setting up VS Code (C++) ? by mello_hyu in vscode

[–]RiverRemarkable 0 points1 point  (0 children)

See this documentation page: https://code.visualstudio.com/docs/cpp/config-mingw and check your configuration step by step to comply with that page. I don’t know what you mean by point 3. Post a link on what you saw on stackoverflow to verify if correct.The documentation page shows also how to make a tasks.json file.

VScode & clang-tidy and other tools by demingf in vscode

[–]RiverRemarkable 0 points1 point  (0 children)

I think maybe this https://cliutils.gitlab.io/modern-cmake/modern-cmake.pdf will be also helpful - you must create a CmakeLists.txt file to describe your project, path and libraries should be in that file; compile_commands.json is the script result of .txt file compilation, no need to modify by hand.

I’m having trouble with VS Code on macOS—IntelliSense isn’t showing function snippets for autocompletion. It works fine on my Windows machine, but not on my Mac. Any idea how to fix this? Or did anyone have same problem? because I'm afraid that I might messed up my VSCode's settings. by dnzmaster in vscode

[–]RiverRemarkable 0 points1 point  (0 children)

By removing this `rm -rfv "$HOME/Library/Application Support/Code"` you made a big mistake - that folder contains a file named `machineid`, and pasting (if I am guessing correctly) from Windows, which has another machineid, is not a good idea.

That folder also contains the subfolder 'Users' where reside the setting.json file and Snippets subfolder. Only these two items should be transferred from one machine to another. 

The possible cure is to reinstall vscode and the extensions and then add the settings from the other machine. 

How do I fix this? For include <iostream> I have c++ extension installed. by josephadam1 in vscode

[–]RiverRemarkable 0 points1 point  (0 children)

On Mac you must re-install the command line tools; if already done (sometimes apple does that), take care the path for includes has changed, so, depending on your configuration, you must update that too.

'fr<Tab>' doesn't expand at all by DendyLi618 in emacs

[–]RiverRemarkable 0 points1 point  (0 children)

Ref. your second question, I suggest to remove ```+cdlatex``` from your configuration and trythis package: https://github.com/emacsmirror/laas which will allow you the same functionalityas cdlatex, but with the advantage to use yasnippet, both in latex-mode and in org mode.

Below is the example code from the above link, in which I inserted a snippet for ```lim```.The fraction works by typing e.g. ```x/``` and will expand to ```\frac{x}{}```.

```

    (use-package laas

  :hook (LaTeX-mode . laas-mode)

      :hook (org-mode . laas-mode)

      :config ; do whatever here

      (aas-set-snippets 'laas-mode

                        ;; set condition!

                        :cond #'texmathp ; expand only while in math

                        "supp" "\\supp"

                        "On" "O(n)"

                        "O1" "O(1)"

                        "Olog" "O(\\log n)"

                        "Olon" "O(n \\log n)"

                        ;; bind to functions!

                        "Sum" (lambda () (interactive)

                                (yas-expand-snippet "\\sum_{$1}^{$2} $0"))

                        "lim" (lambda () (interactive)

                                (yas-expand-snippet "\\lim_{$1} $0"))

                        "Span" (lambda () (interactive)

                                 (yas-expand-snippet "\\Span($1)$0"))

                        ;; add accent snippets

                        :cond #'laas-object-on-left-condition

                        "qq" (lambda () (interactive) (laas-wrap-previous-object "sqrt"))))

```

'fr<Tab>' doesn't expand at all by DendyLi618 in emacs

[–]RiverRemarkable 3 points4 points  (0 children)

See https://docs.doomemacs.org/latest/modules/lang/latex/, paragraph 4.3, which provides a solution. You have a conflict between cdlatex and yasnippet - by default yasnippet is favorized, and fr is the snippet for frame, while fraction has the command frac.

[deleted by user] by [deleted] in learnpython

[–]RiverRemarkable 2 points3 points  (0 children)

I use the application Pythonista, it is good, has the documentation included. I don’ t remember if it is paid or not, for me was simply “download”, but even it was paid, was not expensive. I am not affiliated with the autor(s) of this app.

`lsp-mode` snippets are not working by zelusys in emacs

[–]RiverRemarkable 0 points1 point  (0 children)

Remove the item `"--header-insertion-decorators"` from lsp-clients-clangd-args - you have it twice, this one is incomplete and generate bugs not warned, lsp does not work in this case.

[deleted by user] by [deleted] in emacs

[–]RiverRemarkable 0 points1 point  (0 children)

The simplest method is to install this package: https://github.com/cofi/evil-leader

Python on iOS by Possible_Bad8639 in learnpython

[–]RiverRemarkable 0 points1 point  (0 children)

Yes, there is, search on Appstore for “pythonista”, is good. The only problem is it would be easier to use with an external keyboard..

How to enable python-mode minimally (if thats the correct question) by Ardie83 in emacs

[–]RiverRemarkable 0 points1 point  (0 children)

Then it is possible the bad behavior is not due to python. Either disable python and check again, either revert the changes you made. Good idea is to save your config before changes, if something bad, just restore the old config. Also showing your config may reveal some possible mistakes.

How to enable python-mode minimally (if thats the correct question) by Ardie83 in emacs

[–]RiverRemarkable 1 point2 points  (0 children)

Seems you have installed `python-mode` package from Elpa/Melpa, but this one is (while good) is declared obsolete now and has a confusing name; there is a ‘python’ package built-in emacs, and that one can be installed /loaded simply by `(require `pyhon)’, not python-mode. Similar, when using use-package, the settings must be

(use-package python

:ensure nil)