Git Product home page Git Product logo

cano's Introduction

Cano

Cano (kay-no) is a text editor written in C using the ncurses library. It is a modal-based editor, based heavily on VIM.

Cano icon
Icon from LocalTexan

Quick Start

Dependencies: CC, Make, ncurses

make -B
./main

Modes

Normal - For motions and deletion
Insert - For inserting text
Visual - For selecting text and performing actions on them
Search - For searching of text in the current buffer
Command - For executing commands

Keybinds

Mode Keybind Action
Global Ctrl + Q Quit (regardless of mode)
Global Esc Enter Normal Mode
Normal h Move left
Normal j Move down
Normal k Move up
Normal l Move right
Normal x Delete character
Normal d Delete entire line
Normal g Go to first line
Normal G Go to last line
Normal 0 Go to beginning of line
Normal $ Go to end of line
Normal w Go to next word
Normal b Go to last word
Normal e Go to end of next word
Normal o Create line below current
Normal O Create line above current
Normal ctrl + o Create line below current without changing mode
Normal % Go to corresponding brace
Normal i Enter insert mode
Normal I Go to beginning of line
Normal a Insert mode on next char
Normal A Insert mode at end of line
Normal v Enter visual mode
Normal V Enter visual mode by line
Normal u Undo
Normal U Redo
Normal / Enter search mode
Normal n Jump to next search
Normal Ctrl + S Save and exit
Normal r Replace current char with next char inputted
Normal R + (n) Repeat next motion n times

Visual mode works the same as Normal mode, except works on the entire selection, instead of character by character.

Commands

Command Action
set-output change output file
q Quit
we Write and quit
e Write without quitting
set-var (var) (value) Change a config variable
!(command) Execute a shell command

Config file

The config file is stored in ~/.config/cano/config.cano by default, or can be set at runtime like so:

./cano --config <config_file>

The format of the file is the same as commands, it is line separated, which is important. Example:

set-var syntax 1 
set-var indent 2 

There is a secondary config file, which is for custom syntax highlighting. It is stored in the same folder as the regular config, but uses a different naming format. An example is ~/.config/cano/c.cyntax (spelled cyntax, with a c). The c can be replaced with whatever the file extension of your language is, such as go.cyntax for Golang. Here is an example of a cyntax file:

k,170,68,68,
auto,struct,break,else,switch,case,
enum,register,typedef,extern,return,
union,continue,for,signed,void,do,
if,static,while,default,goto,sizeof,
volatile,const,unsigned.
t,255,165,0,
double,size_t,int,
long,char,float,short.
w,128,160,255.

There's a bit to unpack here, basically the single characters represent the type of the keywords: k - Keyword t - Type w - Word The type is then followed by the RGB values, all comma separated without spaces. After the RGB values, there is the actual keywords. End each type with a dot '.' as seen above, to indicate to Cano that the list is finished. The words are meant to be left blank, as it will highlight any words not found in the keywords above with the chosen RGB color. If you wish to only set the color, you can provide no keywords to any, and it will fill in the keywords with C keywords by default.

Config Variables

relative # toggle relative line numbers
auto-indent # toggle auto indentation on-off
syntax # toggle syntax highlighting on-off
indent # set indent
undo-size # size of undo history 

Installing

Currently, the only way to install is to build the package, or use the AUR.

If using yay, do the following:

yay -S cano-git

Contributing

Cano is open to contributors. That does not mean that your pull request will be merged.
Please structure your pull request as something reasonably small,
so that is is possible to look over in a reasonable amount of time.
For the style, try to keep it as close to the code written as possible.
A pull request will not be rejected for a style conflict.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.