Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emacs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Hauspie
emacs
Commits
2590dda3
Commit
2590dda3
authored
4 years ago
by
Michael Hauspie
Browse files
Options
Downloads
Patches
Plain Diff
Fix rust lsp
parent
e196ce62
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
configuration.org
+19
-19
19 additions, 19 deletions
configuration.org
with
19 additions
and
19 deletions
configuration.org
+
19
−
19
View file @
2590dda3
...
...
@@ -775,18 +775,28 @@ Some of my configuration entries where borrowed from other people, see
#+begin_src emacs-lisp
(use-package lsp-mode
:hook (
c++-mode
python-mode
rust-mode
(c++-mode . lsp)
(python-mode . lsp)
(rust-mode . lsp)
(lsp-mode . lsp-enable-which-key-integration)
)
:config
(lsp-headerline-breadcrumb-mode t))
(lsp-headerline-breadcrumb-mode t)
:commands lsp
)
#+end_src
For displaying more information directly in the buffer, I use =lsp-ui=
#+begin_src emacs-lisp
(use-package lsp-ui)
(use-package lsp-ui
:commands lsp-ui-mode)
#+end_src
LSP keybinds
#+begin_src emacs-lisp
(setq lsp-keymap-prefix "s-l")
#+end_src
*** Integration with treemacs
...
...
@@ -820,29 +830,19 @@ Some of my configuration entries where borrowed from other people, see
*** Rust
Install =rust-mode= and set the rust language server to rls.
([[https://rust-analyzer.github.io/][rust-analyzer]] still crashes too much) It also sets =rustfmt= to be
called to format buffer when saving.
Install =rust-mode= and set the rust language server to [[https://rust-analyzer.github.io/][rust-analyzer]]
#+begin_src emacs-lisp
(use-package rust-mode
:custom
(lsp-rust-server 'r
ls
)
(lsp-rust-server 'r
ust-analyzer
)
; (rust-format-on-save t)
)
#+end_src
For this to work, you need to install =rust-analyzer= and =rustmft=.
#+begin_src bash
echo "Installing rust-analyzer"
git clone https://github.com/rust-analyzer/rust-analyzer.git && cd rust-analyzer
cargo xtask install --server || echo "failed"
echo "Installing rustfmt"
cargo install rustfmt || echo "failed"
#+end_src
For this to work, you need to install =rust-analyzer= in
=~/.cargo/bin=.
Adds cargo installed binaries to exec path
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment