1

I'm looking for a complete list of Remix IDE shortcuts. (Little things make a big difference, and I'm a big fan of efficiency). Through trial and error, here's what I found so far:

  • Opt+Up/Down: Move line up/down
  • CMD+D: Delete line
  • CTR+OPT+Up/Down: Multicursor (super useful)

I would love to be able to CMD+D to highlight word like in Sublime. I've tried searching for Remix IDE shortcuts, searched the doc, but found nothing...

Anybody have their own list or know of a source? Thanks!

2
  • what are shortcuts to comment lines or line on remix and same for undo the comments? Jul 23, 2022 at 15:18
  • To comment and undo comment select the code and make ctrl + shift + A
    – cris.sol
    Feb 24 at 20:09

2 Answers 2

2

Remix uses the Brace Editor package (Github) for its editor window, so shortcuts are inherited from there.

Brace supports both emacs and vim keybindings. (I'm assuming the examples in your question are actually either emacs/vim shortcuts.)

Back in Remix, the .addCommand() method calls in editor.js add a few extra shortcuts on top.

Edit:

My emacs/vim chops are well out of date, so here's another method...

To edit all occurences of a given string:

  • Ctrl+f to open the "Find" window
  • Enter the string
  • Alt+Enter to highlight all instances
  • Type the new string
2
  • What do you mean by "Back in Remix, the .addCommand() method calls in editor.js add a few extra shortcuts on top." Can you elaborate? If you could just help me find out how to select all occurrences of a selected word, that would be great!
    – whamsicore
    May 21, 2021 at 20:39
  • I've edited my answer. What I meant was, Remix inherits various keybindings from the Brace package, but then Remix itself adds some extra keybindings on top (as per the code in editor.js). May 21, 2021 at 20:48
0

const {MerkleTree} = require("merkletreejs"); // import merkletreejs const keccak256 = require("keccak256");// import let whitelistAddresses = [ "0x5B38Da6a701c568545dCfcB03FcB875f56beddC4" ,//A "OxAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2", //B "Ox4B20993Bc481177ec7E8f571ceCaE8A9e22C02db",//c "Ox78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB",//d let leafNode = whitelistAddresses.map(addr=>keccak256(addr));//key=>value //console.log(leafNode); const merkleTree= new MerkleTree (leafNode);//object //console.log(merkleTree); const rootHash = merkleTree.getRoot(); //console.log (rootHash); //claiming address const claimingAddress="0×583031D1113aD414F02576BD6afaBfb302140225" ; // get proof const hexProof = merkleTree.getProof(claimingAddress); console. log(hexProof) //verification const isProofValid = merkleTree.verify(hexProof, claimingAddress, merkleTree.getRoot()); console.log("Is proof valid?", isProofValid);

// SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.9.0;

contract Array { uint[5] public staticArray = [1, 2, 3]; // Static array uint[] public dynamicArray = [1, 2]; // Dynamic array

// Addition of array elements
function additionofElements(uint index, uint element) public {
    staticArray[index] = element;//static array
    dynamicArray.push(element);//dynamic
}

// Deletion of static array element
function deletionofStatic(uint index) public {
    delete staticArray[index];
}

// Deletion of dynamic array element
function deletionofDynamic() public {
    dynamicArray.pop(); // Remove the last element from the array
}

// Finding length of a given array
function getlength() public view returns (uint, uint) {
    return (staticArray.length, dynamicArray.length);
}
 //d. Printing array elements in sorted order
function printSortedDynamicArray() public view returns (uint[] memory) {
    uint[] memory sortedArray = dynamicArray;
    bubbleSort(sortedArray);
    return sortedArray;
}

// Simple bubble sort algorithm for sorting the array
//internal so that Frontend can't give input of array
function bubbleSort(uint[] memory arr) internal pure {
    uint n = arr.length;
    for (uint i = 0; i < n - 1; i++) {
        for (uint j = 0; j < n - i - 1; j++) {
            if (arr[j] > arr[j + 1]) {
                // Swap arr[j] and arr[j + 1]
                (arr[j], arr[j + 1]) = (arr[j + 1], arr[j]);
            }
        }
    }
}

//e.    Searching a particular element in an array 
function search(uint value) public view returns(bool) {
    uint[5] memory array2 = staticArray; //gas optimization
    for(uint i=0;i<staticArray.length;i++){
       if(array2[i]==value){
        return true;
       }
    }
    return false;
}

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.