Fork me on GitHub
#spacemacs
<
2020-06-03
>
dev.4openID10:06:15

on ubuntu using spacemacs - how do I copy from/to spacemacs from another editor (usually C-c C-v) and vica versa?

practicalli-johnny10:06:51

@dev.4openid in Spacemacs you yank or kill some text and it should go into the Ubuntu clipboard and be available from C-v in other editors and applications. To paste into a terminal shell, use the shift key, eg C-S-v. Anything you copy with C-c in Ubuntu can be pasted with p (Evil normal state). I have forgotten all the Emacs keybindings... To yank something using Evil normal state, y y for the current line, v to select a region and y to yank the highlighted region, SPC v to select a symbol (`v` to grow the scope, S-v to shrink the scope of selection) and y to yank. There are other approaches too...

craftybones12:06:53

I’ve hit a major roadblock with Calva and while I love Calva, I am forced to move to Spacemacs. I am just beginning, and it might be weird to ask, but I am guessing most people here are sufficiently happy with spacemacs

spfeiffer12:06:10

„forced to move“? I do not hear that very often…

craftybones12:06:57

@U067P1FT2 - a flair for the dramatic

spfeiffer12:06:55

As you might guess, the ones who hang out in this channel are satisfied with Spacemacs…

craftybones12:06:26

@U067P1FT2 - Indeed. I am unsure where to start though. It seems like the defaults of evil mode should be the right way to go

craftybones12:06:38

documentation time

spfeiffer12:06:15

The @jr0cket Website is an excellent resource

practicalli-johnny13:06:02

and use the Spacemacs develop branch rather than the default master branch

Drew Verlee17:06:33

^^^ @srijayanth read all of https://practicalli.github.io/ then get started, imo.

Drew Verlee17:06:56

i made it hard on myself for not doing that.

Drew Verlee17:06:28

spacemacs comes with more options then you need in some areas and it can be painful if you don't follow the advice there.

Drew Verlee17:06:11

No need to master every section but have it as your go to reference for how to do something. Its likely mentioned in there.

craftybones17:06:52

@U0DJ4T5U1 - thanks, I am well on my way. My familiarity with both vim and emacs helped me immensely

craftybones12:06:08

I’ve used vim almost all my adult life and emacs doesn’t bother me very much

craftybones12:06:56

As long as I have decent nrepl integration with formatting, I am happy

dev.4openID12:06:02

@jr0cket you are right with what you stated. However, I was asking to copy text between spacemacs and a text app - both ways:grin:

practicalli-johnny13:06:49

I already answered that part too...

dev.4openID13:06:06

Darndest thing, I had tried that and did it again. Did not work. Upgraded packages and rebooted spacemacs and now works?!!!!??? Grrrrr"

spfeiffer12:06:07

I think emacs will just share the system clipboard, like a good OS citizen.

Ho0man15:06:36

Sorry to ask here as well

practicalli-johnny15:06:05

Hope the answer in #clj-kondo works for you. If you get stuck let us know. Thanks.

thanks 4
craftybones16:06:46

Is there a way to eval a form in a scratch buffer?

craftybones16:06:34

Is there a function to surround expression with () ?

craftybones17:06:12

I’m using viw to select inner word and then an M-(

practicalli-johnny17:06:55

@srijayanth SPC k w is the smartparens command to wrap an expression, or in Evil I would use SPC v to highlight the expression, or * if its a symbol, and then s ) to surround with () without spaces. There are lots of ways though 🙂

practicalli-johnny17:06:51

, e f is the usual command to evaluate the current form (from the top level). Havent tried the scratch buffer though

craftybones17:06:26

spc k w is cool. Spc v won’t work on hyphenated expressions

flefik09:06:13

you can extend what spacemacs considers a word to include - in clojure-mode and then it works

practicalli-johnny17:06:58

v will expand the SPC v selection and shift v contracts the selection

practicalli-johnny17:06:41

I added a bunch of Evil key combinations on this page as I was learning Vim style editing https://practicalli.github.io/spacemacs/spacemacs-basics/vim-style/speaking-evil.html There are more examples on the following page and a lot more I havent thought of...

craftybones17:06:39

cider-doc requires fully qualified namespace?

craftybones17:06:25

so how would I get the doc of say something under my cursor?

practicalli-johnny17:06:39

@srijayanth with the cursor over the name of a function, , h h or SPC SPC cider-doc will popup a buffer with the clojure docstring for that function. This only works if a Clojure REPL is running for the project. To start a REPL use , ' or SPC SPC cider-jack-in-clj . This works the same for a project or the clojure-scratch buffer, either way you require a running REPL. You will need Clojure CLI or Leinignen installed, eg. http://practicalli.github.io/clojure/getting-started/install-clojure.html

craftybones17:06:48

my clj kondo isn’t working. Not sure why. Master branch

craftybones17:06:29

it is on path, I’ve added flycheck-clj-kondo to dotspacemacs-additional-packages

practicalli-johnny17:06:36

If you havent restarted Emacs since adding that config, that would be the first thing I would do. Just doing SPC f e R does not always resolve the loading order of Emacs packages when they are already running.

craftybones17:06:44

no, restarted it

craftybones17:06:08

dotspacemacs-additional-packages '(flycheck-clj-kondo)

practicalli-johnny18:06:02

Do you also have this in the dotspacemacs/user-config in the .spacemacs file?

(use-package clojure-mode
 :ensure t
 :config
 (require 'flycheck-clj-kondo))

craftybones17:06:13

That line seem alright?

practicalli-johnny17:06:23

SPC e v will run flycheck-verify setup in a Clojure buffer, that may show if there is an error with any particular back end. Confirm you have the syntax-checking layer added to the .spacemacs file. Check the message buffer for errors, SPC b m In general, I do recommend switching Spacemacs develop branch as it has about 2 years worth of fixes and features over Spacemacs master. Here is a guide to switching if you decide you want to https://practicalli.github.io/spacemacs/install-spacemacs/switch-to-develop.html clj-kondo is also easier to install :)

craftybones17:06:48

Ah cool. clj-kondo is installed

craftybones17:06:03

but flycheck mode is disabled

practicalli-johnny17:06:40

When I run SPC e v with the current buffer being in Clojure mode, I get the following output

Syntax checkers for buffer 034_implement_range.clj in clojure-mode:

First checker to run:

  clj-kondo-clj
    - may enable: yes
    - may run:    t
    - executable: Found at /home/practicalli/bin/clj-kondo

Checkers that are compatible with this mode, but will not run until properly configured:

  clj-kondo-edn
    - may enable: yes
    - may run:    nil
    - executable: Found at /home/practicalli/bin/clj-kondo

Flycheck Mode is enabled. Use SPC u C-c ! x to enable disabled checkers.

--------------------

Flycheck version: 32snapshot (package: 20200513.444)
Emacs version:    26.3
System:           x86_64-pc-linux-gnu
Window system:    x

practicalli-johnny18:06:21

The first checker shows that it found clj-kondo-clj has been found, shows it runs and shows which binary its using

craftybones18:06:30

Thanks. Its working well now

craftybones18:06:49

@jr0cket - on your site where you say

SPU u before cider-jack-in displays the command line to be run, ...

craftybones18:06:05

is that SPC u? If so, I am not sure how that works

craftybones18:06:24

I got what you were saying. Prefixing a command with an argument can be done by spc u

👍 4
craftybones18:06:05

Pretty much got most things I want working, the only thing really missing is that I can’t get help to work for the word under cursor

practicalli-johnny18:06:58

Do you have a repl running? Can you evaluate code, e.g using , e f when the cursor is on an expression? Do you get an error when using , h h ? Or a prompt in the mini buffer saying Doc: ?

craftybones18:06:27

I have a repl running, my , e f works

craftybones18:06:35

I am upgrading to development branch, let us see

craftybones18:06:39

Upgraded, but now, I can’t seem to get my autocomplete to work

craftybones18:06:26

Interesting. Autocomplete works but not at a require level

practicalli-johnny19:06:07

auto-complete doesn't complete external libraries in require, but think it does ones for the project. For external libraries you can try enabling clojure-enable-clj-refactor variable on the Clojure layer https://practicalli.github.io/spacemacs/install-spacemacs/enhance-clojure-experience.html