Giter Site home page Giter Site logo

codemirrorsearch's Introduction

CodeMirror Search

Enhanced CodeMirror search and replace

Usage

<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/codemirror.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/addon/mode/overlay.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/addon/scroll/simplescrollbars.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/addon/search/searchcursor.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/addon/selection/mark-selection.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/codemirror.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/addon/scroll/simplescrollbars.css">

<script src="https://rawgit.com/kofifus/New/master/new.min.js"></script>
<script src="https://rawgit.com/kofifus/Combo/master/combo.min.js"></script>    
<script src="https://rawgit.com/kofifus/CodeMirrorSearch/master/cmsearch.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://rawgit.com/kofifus/CodeMirrorSearch/master/cmsearch.css">
    
<style>
  .CodeMirror { border: 1px solid ; height: 400px; width: 400px; margin-left:30px; }
</style>
    
<textarea id="ta"></textarea>

<script>
  let ta=document.getElementById('ta');
  let cm = CodeMirror.fromTextArea(ta, { lineWrapping:true, scrollbarStyle:'simple', showCursorWhenSelecting:true, styleSelectedText:true });
  cm.setValue('some text');
  initCMsearch(cm);      
</script>

Key Bindings

Ctrl-F => show find widget
Ctrl-G / F3 => find next
Shift-Ctrl-G / Shift-F3 => find prev
Shift-Ctrl-F / Ctrl-H => show replace widget
ctrl+F3 / shift+ctrl+H => replace next
shift+ctrl+F3 => replace prev
Shift-Ctrl-R => replace all
Esc => hide widget & highlights

Features

  • combo boxes search and replace
  • find next / find prev / replace next / replace prev / replace all
  • case sensitive / whole word / regular expression / in selection / wrap around / highlight / persistent dialog

Demo

http://plnkr.co/edit/LEEZf2Vt9U6PASRGpsrt?p=preview

codemirrorsearch's People

Contributors

kofifus avatar

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.