File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ " Keybinding for my code-runner
2+ nnoremap rr :w<cr> :FloatermNew --title=code-runner --height=0.6 --width=0.7 --autoclose=0 run % <cr>
3+ nnoremap <expr> ff expand('%:t') ==? 'fish' ? ":FloatermToggle <cr>" : execute(':ls! hR') ==? "" ? ":FloatermNew --title=code-runner --height=0.6 --width=0.7 <cr> <C-\><C-n>:FloatermToggle <cr>:w <cr>:FloatermSend --title=code-runner run % <cr>:FloatermToggle <cr>" : ":w <cr>:FloatermSend --title=code-runner run % <cr>:FloatermToggle <cr>"
4+ tnoremap ff <C-\><C-n>:FloatermToggle <cr>
5+
6+
7+ " INSTALL THE FLOATERM PLUGIN
8+ call plug#begin('~/.vim/plugged')
9+
10+ " Floating Terminal
11+ Plug 'voldikss/vim-floaterm'
12+
13+ call plug#end()
Original file line number Diff line number Diff line change 1+ // Replace only the key argument with your choice of key-combination
2+
3+ // Switch focus between terminal and editor
4+ // Start
5+ {
6+ "key": "alt+space",
7+ "command": "workbench.action.terminal.newWithCwd",
8+ "args": {
9+ "cwd": "${fileDirname}"
10+ },
11+ "when": "!terminalIsOpen"
12+ },
13+ {
14+ "key": "alt+space",
15+ "command": "terminal.focus",
16+ "when": "terminalIsOpen && !terminalFocus"
17+ },
18+ {
19+ "key": "alt+space",
20+ "command": "workbench.action.focusActiveEditorGroup",
21+ "when": "terminalIsOpen && terminalFocus"
22+ },
23+ // End
24+
25+ // My Code runner
26+ // Start
27+ {
28+ "key": "cmd+contextmenu",
29+ "command": "terminal.focus",
30+ "when": "!terminalFocus"
31+ },
32+ {
33+ "key": "cmd+contextmenu",
34+ "command": "workbench.action.terminal.sendSequence",
35+ "args": {"text": "run '${fileBasename}'\u000D"},
36+ "when": "terminalIsOpen && terminalFocus"
37+ }
38+ // End
You can’t perform that action at this time.
0 commit comments