-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.nanorc
224 lines (200 loc) · 10.1 KB
/
.nanorc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
## If you wish, you may put your syntaxes in separate files. You can
## make use of such files as follows:
##
## include "/path/to/syntax_file.nanorc"
##
## Unless otherwise noted, the name of the syntax file (without the
## ".nanorc" extension) should be the same as the "short description"
## name inside that file. These names are kept fairly short to make
## them easier to remember and faster to type using nano's -Y option.
#
#
#
#
###############################################################
### Set behavioral flags
###############################################################
set atblanks # Command line flag -a
set colonparsing # Command line flag --colonparsing; added in version 8.1
set constantshow # Command line flag -c
#set multibuffer # Command line flag -F
#set nonewlines # Command line flag --nonewlines
set showcursor # Command line flag -g
set smarthome # Command line flag -A
# set suspendable # Command line flag -z; enabled by default in v6.0, but the default binding is Ctrl+T,Ctrl+Z
set tabsize 4 # Command line flag -T 4
set trimblanks # Command line flag -M
set zap # Command line flag -Z
## Explicitly enforced behavior
unset breaklonglines # Command line flag -w (or '--nowrap'); explicitly prohibit automatic hard-wrapping long lines; opposite of '-b'
# set smooth -- This is now the default behavior as of nano v4.0; when needed, use 'unset jumpyscrolling' or command line flag '-j' instead
unset jumpyscrolling # Command line flag N/A; explicitly enforce smooth scrolling; opposite of 'unset jumpyscrolling' and command line flag '-j'
unset nohelp # Command line flag N/A; explicitly enforce display of help lines; opposite of command line flag -x
unset stateflags # Command line flag -% (or '--stateflags'); I don't find the '*' after the filename in the titlebar as obvious an indicator of a file's modified state as having "Modified" appear on the right. It's a shame, because part of me wants the stateflag characters too.
###############################################################
### Include syntax-specific nanorc files
###############################################################
include "~/.config/nano/asm.nanorc"
include "~/.config/nano/awk.nanorc"
include "~/.config/nano/bash.nanorc"
include "~/.config/nano/c.nanorc"
include "~/.config/nano/cmake.nanorc"
include "~/.config/nano/conf.nanorc"
include "~/.config/nano/csh.nanorc"
include "~/.config/nano/css.nanorc"
include "~/.config/nano/etc-hosts.nanorc"
include "~/.config/nano/git.nanorc"
include "~/.config/nano/gradle.nanorc"
include "~/.config/nano/html.nanorc"
include "~/.config/nano/inputrc.nanorc"
include "~/.config/nano/java.nanorc"
include "~/.config/nano/javascript.nanorc"
include "~/.config/nano/json.nanorc"
include "~/.config/nano/keymap.nanorc"
include "~/.config/nano/lua.nanorc"
include "~/.config/nano/makefile.nanorc"
include "~/.config/nano/man.nanorc"
include "~/.config/nano/markdown.nanorc"
include "~/.config/nano/nanohelp.nanorc"
include "~/.config/nano/nanorc.nanorc"
include "~/.config/nano/perl.nanorc"
include "~/.config/nano/pkgbuild.nanorc"
include "~/.config/nano/pkg-config.nanorc"
include "~/.config/nano/properties.nanorc"
include "~/.config/nano/python.nanorc"
include "~/.config/nano/reST.nanorc"
include "~/.config/nano/ruby.nanorc"
include "~/.config/nano/sed.nanorc"
include "~/.config/nano/sql.nanorc"
#include "~/.config/nano/sqliterc.nanorc" Unable to use extendsyntax in an included nanorc
include "~/.config/nano/svn.nanorc"
include "~/.config/nano/tcl.nanorc"
include "~/.config/nano/toml.nanorc"
include "~/.config/nano/verilog.nanorc"
include "~/.config/nano/xml.nanorc"
include "~/.config/nano/yaml.nanorc"
include "~/.config/nano/zsh.nanorc"
extendsyntax python linter ruff check
#extendsyntax python formatter ruff format
## In Makefiles, the Tab key should always insert use the Tab character
## ***DISABLED INDEFINITELY*** Sadly, the syntax name used by `scopatz/nanorc` for makefiles is "Makefile",
## while the built-in name is "makefile". The trouble is that these names are case-sensitive, `syntax` itself cant be extended,
## and trying to extend a syntax name seemingly can't be made conditionally,
## nor can the errors produced by trying to extend an unknown syntax name be silently and gracefully suppressed.
#extendsyntax makefile tabgives " "
############## Uncomment to enforce no syntax highlighting for txt files
##
#syntax "plaintext" "\.txt"
###############################################################
## Paint the interface elements of nano. These are examples;
## by default there are no colors, except for errorcolor.
###############################################################
# set titlecolor brightwhite,blue
# set statuscolor brightwhite,green
# set errorcolor brightwhite,red
# set selectedcolor brightwhite,magenta
# set stripecolor ,yellow
# set scrollercolor cyan
# set numbercolor cyan
set keycolor cyan
# set functioncolor green
# set spotlightcolor black,yellow
# set promptcolor black,white
## In root's .nanorc you might want to use:
# set titlecolor brightwhite,magenta
# set statuscolor brightwhite,magenta
# set errorcolor brightwhite,red
# set selectedcolor brightwhite,cyan
# set stripecolor ,yellow
# set scrollercolor magenta
# set numbercolor magenta
# set keycolor brightmagenta
# set functioncolor magenta
# set spotlightcolor black,orange
# set promptcolor red,white
###############################################################
## Key bindings.
## For more details, see nanorc(5) (section REBINDING KEYS)
###############################################################
## The <Ctrl+Delete> keystroke deletes the word to the right of the cursor.
## On some terminals the <Ctrl+Backspace> keystroke produces ^H, which is
## the ASCII character for backspace, so it is bound by default to the
## backspace function. The <Backspace> key itself produces a different
## keycode, which is hard-bound to the backspace function. So, if you
## normally use <Backspace> for backspacing and not ^H, you can make
## <Ctrl+Backspace> delete the word to the left of the cursor with:
# OLD binding:
# bind ^H cutwordleft main
# CURRENT binding:
# bind ^H chopwordleft main
## If you would like nano to have keybindings that are more "usual",
## such as ^O for Open, ^F for Find, ^H for Help, and ^Q for Quit,
## then uncomment these:
#bind ^Q exit all
#bind ^S savefile main
#bind ^W writeout main
#bind ^O insert main
#bind ^H help all
#bind ^H exit help
#bind ^F whereis all
#bind ^G findnext all
#bind ^B wherewas all
#bind ^D findprevious all
#bind ^R replace main
#bind M-X flipnewbuffer all
#bind ^X cut all
#bind ^C copy main
#bind ^V paste all
#bind ^P location main
#bind ^A mark main
#unbind ^K all
#unbind ^U all
#unbind ^N main
#unbind ^Y all
#unbind M-J main
#unbind M-T main
#bind ^T gotoline main
#bind ^T gotodir browser
#bind ^Y speller main
#bind M-U undo main
#bind M-R redo main
#bind ^U undo main
#bind ^E redo main
#set multibuffer
unbind M-E main # Stop using Alt/Meta+E to redo actions
unbind M-X all # Prevent disabling nohelp everywhere; it should really be enabled at all times
unbind M-C main # Prevent disabling constantshow in the main view; it should really be enabled at all times
unbind M-H main # Prevent disabling smarthome in the main view; it should really be enabled at all times
unbind ^B main # Free up Ctrl+b for use of findbracket action
unbind ^_ all # Free up Ctrl+Shift+-, keeping Alt+g for the Go To Position command
unbind ^J main # I pretty much never WANT to justify text, and I reflexively press this when I want to join lines, so this is an annoyance; keeping F4 for the rare instance.
unbind ^L main # Since nano version 8.1, this is bound to both refresh and cycle by default; I don't want cycle
unbind M-B main # Free this up to ensure it can be used to run the linter
unbind M-F main # Free this up to ensure it can be used to run the formatter
# Delete word to left of cursor with Ctrl+H (Ctrl+Backspace)
bind ^H chopwordleft main #TODO: may actually want to disable this for my main machine; further use required
# My current main computer simply insists that backspace always be either ^_ or ^? (depending on modifier keys)
# Delete still does everything it should be doing, and backspace works as it should when no modifier keys are pressed
# As such, what happens if we bind ^_ to chopwordleft? Suddenly backspace starts behaving correctly when Control is held!
# Huzzah! Now if only I could figure out why this was necessary to begin with.
bind ^_ chopwordleft main
bind ^Space complete all # Attempt word completion with Ctrl+Space
bind ^B findbracket main # Find a matching bracket with Ctrl+B
bind Sh-M-Z redo main # Also allow use of Shift+[Alt|Meta]+Z to redo actions
bind M-Y redo main # Use Alt/Meta+Y to redo actions
bind M-U undo main # Use Alt/Meta+U to undo actions
bind ^Z suspend main # Restore use of Ctrl+Z to suspend
bind ^L refresh main # Re-bind ^L to refresh, as it has been for so long.
bind M-B linter main # Not sure why this binding exists on one machine and not another, but I fix :)
bind M-F formatter main # Not sure why this binding exists on one machine and not another, but I fix :)
##### I wish these worked :(
# bind ^Enter complete all # Attempt word completion with Ctrl+Enter
# bind Sh-space pageup help # Press shift+Space to scroll up a page in the help view
# bind ^PgUp prevbuf main # Switch to the previous file passed to nano with Ctrl+PageUp
# bind ^PgDn nextbuf main # Switch to the next file passed to nano with Ctrl+PageUp
# bind ^{ prevblock main # Move up a text-block with Ctrl+]
# bind ^} nextblock main # Move down a text-block with Ctrl+[
# bind ^Up scrollup main # Ctrl+Up is supposed to move the view without moving the caret, who decided to make it do Alt+Up's job?
# bind ^Dn scrolldown main # Ctrl+Dn is supposed to move the view without moving the caret, who decided to make it do Alt+Dn's job?
# bind M-Up prevblock main # Alt+Up is supposed to move the caret to the start of the previous block, so why has it been switched with Ctrl+Up?
# bind M-Dn nextblock main # Alt+Dn is supposed to move the caret to the start of the next block, so why has it been switched with Ctrl+Dn?