Notes about Emacs
1 Install the emacs
brew install emacs-plus@27 [options]
2 Some commonly used keyboard shortcut in emacs
Operations | Commands |
---|---|
copy | M-w |
cut | C-w |
undo | C-x-u |
select | C-space |
paste | C-y |
save | C-x-C-s |
delete forward | M-D |
delete backward | M-delete |
go to line number | M-g-g |
split the window | C-x-3 |
export to | C-c-C-e |
go to the end of the line | C-e |
shift to another window | C-x-o |
show all the buffers | C-x-b |
go to the next buffer | C-x- -> |
kill a buffer | C-x-k |
create ordered numbering list | M-enter |
open a link inside the org file | C-c-C-o |
M
: stands for the alt/option
button
C
: stands for the control
button
3 Useful commands for Python
C-c-C-c
: send the full python script to python buffer
M-x-run-python
: select the segments to the python buffer used for debugging. Then use C-c-C-c
to run it.
C- up-arrow
: in python buffer to see the history of commnads
C-down-arrow
: in python file will move the cursor faster, skips the blank spaces
C-c-C-d
: in python file to show the documentation
M-x-my-clear
: clears the history in ipython shell where my-clear
is the predefined function in the init.org file shown as below.
(defun my-clear () (interactive) (let ((comint-buffer-maximum-size 0)) (comint-truncate-buffer)))
4 Basics on using Magit
5 Basics on linking files to another
- open the to-be-linked file and press
C-c-l
- write the description for the to-be-linked file
- go to the main file and press
C-c-C-l
6 Some common commands in Puhti
- login to Puhti
ssh username@puhti.csc.fi
- check the workpaces in a folder (how many spaces taken by each folder)
du -sh *
- check one's own workspace under a folder in Puhti
csc-workspaces
- run job in the interactivate way
srun --ntasks=1 --time=00:15:00 --gres=gpu:v100:1 --mem=1G --pty --account=asignal --partition=gputest bash