Thank you for the post. But i think Spacemacs is too heavy. My code is mainly focus on c/c++, and a bit of shell code.....You might want to look into what Spacemacs provides. It contains a huge amount of great software and you can configure it relatively easily, no matter if you use evil mode or not.
Thanks for your reply. I think etags/ctags can not find the reference calls of functions. And how do you solve this? grep or rip-grep?The default install of emacs includes a decent c/c++ mode, plus a bunch of other modes by default like javascript/js, java, etc.
Only thing I've added beyond default install is yaml-mode.el
Tags: etags/ctags
(load-file "/usr/src/tools/tools/editing/freebsd.el")
(defun my-c-mode-hook ()
(c-set-style "bsd")
(c-set-offset 'substatement-open '0) ; brackets should be at same indentation level as the statements they open
(c-set-offset 'inline-open '+)
(c-set-offset 'block-open '+)
(c-set-offset 'brace-list-open '+) ; all "opens" should be indented by the c-indent-level
(c-set-offset 'case-label '-)) ; indent case labels by c-indent-level, too
(add-hook 'c-mode-hook 'my-c-mode-hook)
; turn on semantic
(semantic-mode 1)
; toggle tag decoration?
(global-semantic-decoration-mode 1)
;; enable auto complete
I'm very much an emacs novice, but will try and include this. I prefer runningFound this in my init.el - hope this is of use to you?
Code:(load-file "/usr/src/tools/tools/editing/freebsd.el") (defun my-c-mode-hook () (c-set-style "bsd") (c-set-offset 'substatement-open '0) ; brackets should be at same indentation level as the statements they open (c-set-offset 'inline-open '+) (c-set-offset 'block-open '+) (c-set-offset 'brace-list-open '+) ; all "opens" should be indented by the c-indent-level (c-set-offset 'case-label '-)) ; indent case labels by c-indent-level, too (add-hook 'c-mode-hook 'my-c-mode-hook) ; turn on semantic (semantic-mode 1) ; toggle tag decoration? (global-semantic-decoration-mode 1) ;; enable auto complete
emacs -nw
and am slowly trying to configure things.Emacs. I've always thought of it as "the first IDE".I'm very much an emacs novice, but will try and include this. I prefer runningemacs -nw
and am slowly trying to configure things.
It would be nice to understand all this... Just wish I'd started using emacs 20 years ago as there's a lot to learn.
Could emacs gurus tell me if I can set up Ctl-Ins and Sh-ins for copy and paste in Emacs?
Ctrl-h k C-<Ins>
Ctrl-h k S-<Ins>
C-<Ins>
to try and copy it and then S-<Ins>
to try and paste it. Works for me. M-x describe-keymap
Is it possible to redefine CUA somewhere within emacs?
(cua-mode -1)
to your emacs init file and restarting emacs. If you want to redefine it some other way you'll have to be more specific.When you say 'redefine', do you mean turn it off? Or rebind the keys to something else? Turning it off is as simple as adding(cua-mode -1)
to your emacs init file and restarting emacs. If you want to redefine it some other way you'll have to be more specific.
The best way to learn emacs (in my opinion) is not to start with any of the starter kits (doom, spacemacs etc) but with a vanilla set up. And then start using it and doing everything in it that you would do in your usual editor. This forces you to confront fixing your pain points as you come across them and forces you to learn how to navigate the documentation, how to pick up small bits of emacs lisp and how to tweak your init file to suit your needs. If you can version control your init file usingIt would be nice to understand all this... Just wish I'd started using emacs 20 years ago as there's a lot to learn.
git
then so much the better as this will simplify any mistakes you make. Then it's just a simple git restore
to return to a working config. It also gives you the confidence to try things out knowing that you can always get back to something that will work. I would also suggest trying to pick up some emacs lisp to make tweaking your config less daunting. And if you can use emacs at work so that you're using it 8 hours a day rather than trying to pick it up in your spare time then this will also pay dividends as it increases your exposure, making things second nature. There are lots of emacs tutorials and blogs on the net, but I found Mike Zamansky's videos really helpful. Each video is only about 10 minutes long, but he walks through setting up various packages and modes in an easy-going manner showing you what's possible and where to find help etc. Highly recommended.I don't use CUA mode, but according to the EmacsWiki:I'm not really certain how copy/paste are defined under CUA
The best way to learn emacs (in my opinion) is not to start with any of the starter kits (doom, spacemacs etc) but with a vanilla set up. And then start using it and doing everything in it that you would do in your usual editor. This forces you to confront fixing your pain points as you come across them and forces you to learn how to navigate the documentation, how to pick up small bits of emacs lisp and how to tweak your init file to suit your needs. If you can version control your init file usinggit
then so much the better as this will simplify any mistakes you make. Then it's just a simplegit restore
to return to a working config. It also gives you the confidence to try things out knowing that you can always get back to something that will work. I would also suggest trying to pick up some emacs lisp to make tweaking your config less daunting. And if you can use emacs at work so that you're using it 8 hours a day rather than trying to pick it up in your spare time then this will also pay dividends as it increases your exposure, making things second nature. There are lots of emacs tutorials and blogs on the net, but I found Mike Zamansky's videos really helpful. Each video is only about 10 minutes long, but he walks through setting up various packages and modes in an easy-going manner showing you what's possible and where to find help etc. Highly recommended.
However, one thing you should know now, is that no matter how long you try and learn emacs you never 'arrive', so just sit back, relax and enjoy the journey because it never ends!
To get you started you could take a look at either of the websites below. They will generate a bare-bones skeleton init file to bootstrap you (including themes). And if you bork anything you can always go back to it and start again.I think I will need to start with my own init.el written from scratch.
Put the file color-theme.el and the folder themes (with the files color-theme-example.el and color-theme-library.el) in a directory on your LoadPath. The main function to use is ‘color-theme-select’. It creates the Color Theme Selection buffer that allows you to test the themes before choosing one.
M-x load-library RET color-theme RET
M-x color-theme-select RET
M-x customize-themes
. And then just select a theme to try. You can always go back to libraries like that when you have more experience and understand a bit more how Emacs works.I realise how to get to the parent directory, but you end up with a buffer for the directory you just visited which can up with loads of buffers when you are looking around the filesystem. Just wondered if there is a 'tree-mode' when usingTo go back up a directory indired
just navigate to the entry in the current folder with the double ellipses and hit enter:
drwxr-xr-x 23 balanga balanga 1536 20 Aug 07:35 ..
It's basically thedired
equivalent tocd ../
at the command-line.
dired
.