Jakie użyteczne makra stworzyłeś w Netbeans? [zamknięte]

Używam Netbeans (nightly build) do tworzenia Ruby on Rails i chcę ulepszyć Moje makra. Sam stworzyłem kilka:

Identyfikator kopii:

select-identifier copy-to-clipboard

Wklej Schowek nad identyfikatorem:

select-identifier paste-from-clipboard

Podwójny element cudzysłowu

select-element-next "\""

Pojedynczy element cytatu:

select-element-next "'"
Ale szukam innych przydatnych, a Google nic mi nie daje. Funkcja nagrywania makr zwykle nie działa zbyt dobrze, więc wolałbym po prostu" napisać " makra sam, ale nie mogę znajdź nawet referencję, która wyświetla, jakie polecenia (takie jak "select-identifier") są rzeczywiście dostępne.

Jacyś Guru Makro Netbeans?

Author: Richard Poirier, 2009-02-20

13 answers

Tutaj {[3] } znajduje się lista kodów makr z krótkimi objaśnieniami. Może się komuś przydać.

Update: zastąpiono Stary link do strony Netbeans i dodano tutaj listę makr.

abbrev-debug-line   Debug Filename and Line Number
adjust-caret-bottom Move Insertion Point to Bottom
adjust-caret-center Move Insertion Point to Center
adjust-caret-top    Move Insertion Point to Top
adjust-window-bottom    Scroll Insertion Point to Bottom
adjust-window-center    Scroll Insertion Point to Center
adjust-window-top   Scroll Insertion Point to Top
all-completion-show Show All Code Completion Popup
annotations-cycling Annotations Cycling
beep    Beep
build-popup-menu    Build Popup Menu
build-tool-tip  Build Tool Tip
caret-backward  Insertion Point Backward
caret-begin Insertion Point to Beginning of Document
caret-begin-line    Insertion Point to Beginning of Text on Line
caret-begin-word    Insertion Point to Beginning of Word
caret-down  Insertion Point Down
caret-end   Insertion Point to End of Document
caret-end-line  Insertion Point to End of Line
caret-end-word  Insertion Point to End of Word
caret-forward   Insertion Point Forward
caret-line-first-column Insertion Point to Beginning of Line
caret-next-word caret-next-word
caret-previous-word caret-previous-word
caret-up    Insertion Point Up
collapse-all-code-block-folds   Collapse All Java Code
collapse-all-folds  Collapse All
collapse-all-javadoc-folds  Collapse All Javadoc
collapse-fold   Collapse Fold
comment Comment
complete-line   Complete Line
complete-line-newline   Complete Line and Create New Line
completion-show Show Code Completion Popup
copy-selection-else-line-down   Copy Selection else Line down
copy-selection-else-line-up Copy Selection else Line up
copy-to-clipboard   Copy
cut-to-clipboard    Cut
cut-to-line-begin   Cut from Insertion Point to Line Begining
cut-to-line-end Cut from Insertion Point to Line End
default-typed   Default Typed
delete-next Delete Next Character
delete-previous Delete Previous Character
documentation-show  Show Documentation Popup
dump-view-hierarchy Dump View Hierarchy
expand-all-code-block-folds Expand All Java Code
expand-all-folds    Expand All
expand-all-javadoc-folds    Expand All Javadoc
expand-fold Expand Fold
fast-import Fast Import
find-next   Find Next Occurrence
find-previous   Find Previous Occurrence
find-selection  Find Selection
first-non-white Go to First Non-whitespace Char
fix-imports Fix Imports
format  Format
generate-code   Insert Code
generate-fold-popup Generate Fold Popup
generate-goto-popup Generate Goto Popup
generate-gutter-popup   Margin
goto    Go to Line...
goto-declaration    Go to Declaration
goto-help   Go to Javadoc
goto-implementation Go to Implementation
goto-source Go to Source
goto-super-implementation   Go to Super Implementation
in-place-refactoring    Instant Rename
incremental-search-backward Incremental Search Backward
incremental-search-forward  Incremental Search Forward
insert-break    Insert Newline
insert-date-time    Insert Current Date and Time
insert-tab  Insert Tab
introduce-constant  Introduce Constant...
introduce-field Introduce Field...
introduce-method    Introduce Method...
introduce-variable  Introduce Variable...
java-next-marked-occurrence Navigate to Next Occurrence
java-prev-marked-occurrence Navigate to Previous Occurrence
jump-list-last-edit Last edit
jump-list-next  Forward
jump-list-prev  Back
last-non-white  Go to Last Non-whitespace Char
make-getter Replace Variable With its Getter
make-is Replace Variable With its is* Method
make-setter Replace Variable With its Setter
match-brace Insertion Point to Matching Brace
move-selection-else-line-down   Move Selection else Line down
move-selection-else-line-up Move Selection else Line up
org.openide.actions.PopupAction Show Popup Menu
page-down   Page Down
page-up Page Up
paste-formated  Paste Formatted
paste-from-clipboard    Paste
redo    Redo
reindent-line   Re-indent Current Line or Selection
remove-line Delete Line
remove-line-begin   Delete Preceding Characters in Line
remove-selection    Delete Selection
remove-tab  Delete Tab
remove-trailing-spaces  Remove Trailing Spaces
remove-word-next    remove-word-next
remove-word-previous    remove-word-previous
replace Replace
run-macro   Run Macro
scroll-down Scroll Down
scroll-up   Scroll Up
select-all  Select All
select-element-next Select Next Element
select-element-previous Select Previous Element
select-identifier   Select Identifier
select-line Select Line
select-next-parameter   Select Next Parameter
select-word Select Word
selection-backward  Extend Selection Backward
selection-begin Extend Selection to Beginning of Document
selection-begin-line    Extend Selection to Beginning of Text on Line
selection-begin-word    Extend Selection to Beginning of Word
selection-down  Extend Selection Down
selection-end   Extend Selection to End of Document
selection-end-line  Extend Selection to End of Line
selection-end-word  Extend Selection to End of Word
selection-first-non-white   Extend Selection to First Non-whitespace Char
selection-forward   Extend Selection Forward
selection-last-non-white    Extend Selection to Last Non-whitespace Char
selection-line-first-column Extend Selection to Beginning of Line
selection-match-brace   Extend Selection to Matching Brace
selection-next-word selection-next-word
selection-page-down Extend Selection to Next Page
selection-page-up   Extend Selection to Previous Page
selection-previous-word selection-previous-word
selection-up    Extend Selection Up
shift-line-left Shift Line Left
shift-line-right    Shift Line Right
split-line  Split Line
start-macro-recording   Start Macro Recording
start-new-line  Start New Line
stop-macro-recording    Stop Macro Recording
switch-case Switch Case
to-lower-case   To Lowercase
to-upper-case   To Uppercase
toggle-case-identifier-begin    Switch Capitalization of Identifier
toggle-comment  Toggle Comment
toggle-highlight-search Toggle Highlight Search
toggle-line-numbers Toggle Line Numbers
toggle-non-printable-characters Toggle Non-printable Characters
toggle-toolbar  Toggle Toolbar
toggle-typing-mode  Toggle Typing Mode
tooltip-show    Show Code Completion Tip Popup
uncomment   Uncomment
undo    Undo
word-match-next Next Matching Word
word-match-prev Previous Matching Word
 22
Author: MicSim,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-02-13 12:29:26

Musiałem otoczyć fragmenty tekstu znacznikami HTML, ale nie mogłem wymyślić, jak to zrobić szybko, więc wymyśliłem to makro:

cut-to-clipboard "<strong>" paste-from-clipboard "</strong>"

Prosty, czysty i możesz umieścić dowolny znacznik / tekst, który chcesz. Daj mu skrót jak Alt + B i masz szybki sposób wstawić HTML

 9
Author: arq007,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-07-30 10:35:51

Dla php dodaj średnik do end line ("complete line")
ale trzymaj kursor w bieżącym punkcie, więc możesz pisać resztę linii

split-line
caret-down
caret-end-line ";" 
caret-begin-line 
selection-begin-line remove-selection 
delete-previous
 7
Author: eeneemeenee,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-11-10 13:15:14

To moje pierwsze makro netbeans.

"echo' '; print_r (); die (); "

Mój klawisz skrótu = > Alt+a

Do tego możesz użyć dowolnego skrótu

 2
Author: Dhruba,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-05-25 11:19:29

No cóż, po prostu eksperymentuję z netbeans.

Dodaję proste nowe makro dla netbeans. nazwa: "scrollup_newline" kod: insert-break scroll-up

To działa dobrze, więc każde naciśnięcie enter, edytor przesuwa się o jedną linię w dół. W ten sposób mogę kodować i mieć karetkę w środku edytora.

 2
Author: Serlock,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-02-03 09:03:34

To jest dla HTML. Właśnie zrobiłem:

caret-begin-line "<li>" caret-end-line "</li>" caret-down

Zmapowałem to do ctrl + shift + L to jest moje pierwsze makro netbeans. Później może uda mi się to jakoś zrobić dla całej selekcji.

Edit: Nie wiem, jak to zrobić dla selekcji, ale dodanie "caret-down" na końcu było prawie tak dobre.

 1
Author: Syntax Error,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-05-03 21:03:43

Oto makro, które dziś napisałem. Bardzo brakuje mi refaktoryzacji" extract method "lub" introduce method " w PHP, więc napisałem to makro. Wiem, że jest to znacznie mniej skomplikowane niż refaktoryzacje w Javie, ale może być używane i oszczędza kilka kopii / past i pisanie powtarzalnego kodu.

cut-to-clipboard
"$this->UNNAMED_METHOD();"
collapse-fold
caret-end-line caret-backward caret-end-line insert-break
"private function UNNAMED_METHOD() {"insert-break
paste-from-clipboard insert-break
 1
Author: Patkos Csaba,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-10-28 18:34:40

To makro wstawia -moz- i -webkit- prefiksowe odpowiedniki reguły stylu css3:

caret-end-line selection-begin-line copy-to-clipboard caret-backward insert-break caret-up "-webkit-" paste-from-clipboard insert-break "-moz-" paste-from-clipboard
 1
Author: wheresrhys,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-03-16 16:29:37
insert-date-time remove-word-previous remove-word-previous

Zmapowane do CTRL + SHIFT + D, aby wstawić krótką datę, więc przydatne, ponieważ lubię datować Moje komentarze / TODOs, ale często nie znam daty!

Chociaż myślę, że szablony kodu i bardziej przydatne, na przykład:

           // <editor-fold defaultstate="collapsed" desc="${cursor}">

I

           // </editor-fold>

Mapowane do' fold 'następnie tab i' endfold ' następnie tab odpowiednio.

Również

JOptionPane.showMessageDialog(null, "${EXP default="Got here"}");

Mapowane do 'jop', wtedy Tab jest przydatny.

 1
Author: RyanfaeScotland,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-04-03 16:44:37

Prawdopodobnie nie najskuteczniejszy ale mi pomaga lol

"(() ? : );"
caret-backward
caret-backward
caret-backward
caret-backward
caret-backward
caret-backward
caret-backward
caret-backward

Jak widać, jest to dla PHP quick conditionals. Spowoduje to umieszczenie kursora w miejscu, w którym zaczynasz wpisywać warunek. Idealny bez względu na to, gdzie go rzucasz. Wkładam to do Ctrl + NUMPAD0, aby uzyskać szybki dostęp do pisania. Początkowo miałem go do dwóch zakładek, ale szybko zrobiło się irytujące haha

 0
Author: RedactedProfile,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-06-27 16:42:07

Często lubię mieć przecinki jako pierwszy znak oddzielający Właściwości lub elementy listy w JavaScript; w ten sposób:

var foo = {
    a : 'a'
    //, b : 'B' //todo: make lcase
    , c : 'c'
};

Czasami albo zapominam o tym, albo mam masę tekstu do zaktualizowania. Aby je szybko naprawić, przypiąłem skrót klawiaturowy C-, C-, -- to dwa naciśnięcia', ' trzymając klawisz CTRL -- do:

caret-end-line selection-next-word selection-next-word " " caret-backward caret-backward insert-break
 0
Author: Z Douglas,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-11-03 12:33:28

Uznałem szablony kodu za bardzo przydatne, szczególnie ten (dla HTML):

<${tag}>${cursor}</${tag}>

Skrót to " tt " i może również otaczać dowolny tekst niestandardowym znacznikiem, gdy jest wywoływany przez menu szablonu kodu.

<${param_name default="tag"}${cursor}>
${selection}
</${param_name default="tag"}>

Ten otoczy wszystko dowolnym tagiem. Wybierz coś, następnie Alt + F3, a następnie wybierz ten szablon z menu. Następnie wpisz żądany tag, np. "div".

 0
Author: Blum,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-07-16 12:37:48

Jest to szablon kodu do tworzenia statycznego loggera w klasie używającej SLF4J. przywiązuję go do "Log".

private static final ${loggerType type="org.slf4j.Logger" default="Logger" editable="false"} log = ${loggerFactoryType type="org.slf4j.LoggerFactory" default="LoggerFactory" editable="false"}.getLogger(${classType editable="false" currClassName default="getClass()"}.class);
To tworzy dziennik.linia debugowania, którą przywiązuję do "log":
log.debug("${message}", "${variables}");
 0
Author: Sarel Botha,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2012-08-16 21:15:04